ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dit::did::Did Class Reference

Data Interface Dictionary class. More...

#include <Did.hpp>

Public Types

enum  HeaderSpecifier {
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL
}
 
enum  HeaderSpecifier {
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL
}
 
enum  HeaderSpecifier {
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL,
  DID_HDR_NONE = 0, DID_HDR_FIRST, DID_HDR_LAST, DID_HDR_ALL
}
 

Public Member Functions

 Did ()
 
 ~Did ()
 
void Load (const std::string &did_filename, const bool merge=false)
 Load the referenced dictionary. More...
 
void Clear ()
 Clear the object. More...
 
const ctd::defines::List
< std::string > & 
GetDidsLoaded () const
 Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded). More...
 
const ctd::defines::List
< dit::did::Header > & 
GetHeaders () const
 Get the header objects for the DIDs loaded (el [0] = first DID loaded). More...
 
bool HasRecord (const std::string &pattern, const bool allow_idx_subst=true) const
 Check if a record, is contained in the object. More...
 
bool LookUp (const std::string &pattern, dit::did::Record &record, const bool allow_idx_subst=true, const bool exception=true) const
 Look up a key in the DIDs loaded. First occurrence taken. More...
 
void Scan (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool stop_first_match=false, const std::list< std::string > &classes={"*"}, const ctd::defines::DataType data_types=ctd::defines::DATA_TYPE_ALL, const std::string &format_req_ex="*", const std::string &default_value_reg_ex="*", const std::string &unit_reg_ex="*", const std::string &comment_req_ex="*", const std::list< std::string > &tags_reg_ex={"*"}, const std::string &description_req_ex="*") const
 Scan dictionary for key records with the given properties. More...
 
bool LookUp (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool exception=false) const
 LookUp Scan the dictionary for keys with the given regular expression pattern. More...
 
void Add (dit::did::Record &record)
 Add a keyword record in the dictionary object. More...
 
void GetKeys (ctd::defines::List< std::string > &keys) const
 Generate list of keys defined. More...
 
std::string Print (const HeaderSpecifier print_header=DID_HDR_LAST, const std::string &pattern="", const bool compact=false) const
 Create a DID from the content in the object in a string buffer. More...
 
 Did ()
 
 ~Did ()
 
void Load (const std::string &did_filename, const bool merge=false)
 Load the referenced dictionary. More...
 
void Clear ()
 Clear the object. More...
 
const ctd::defines::List
< std::string > & 
GetDidsLoaded () const
 Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded). More...
 
const ctd::defines::List
< dit::did::Header > & 
GetHeaders () const
 Get the header objects for the DIDs loaded (el [0] = first DID loaded). More...
 
bool HasRecord (const std::string &pattern, const bool allow_idx_subst=true) const
 Check if a record, is contained in the object. More...
 
bool LookUp (const std::string &pattern, dit::did::Record &record, const bool allow_idx_subst=true, const bool exception=true) const
 Look up a key in the DIDs loaded. First occurrence taken. More...
 
void Scan (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool stop_first_match=false, const std::list< std::string > &classes={"*"}, const ctd::defines::DataType data_types=ctd::defines::DATA_TYPE_ALL, const std::string &format_req_ex="*", const std::string &default_value_reg_ex="*", const std::string &unit_reg_ex="*", const std::string &comment_req_ex="*", const std::list< std::string > &tags_reg_ex={"*"}, const std::string &description_req_ex="*") const
 Scan dictionary for key records with the given properties. More...
 
bool LookUp (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool exception=false) const
 LookUp Scan the dictionary for keys with the given regular expression pattern. More...
 
void Add (dit::did::Record &record)
 Add a keyword record in the dictionary object. More...
 
void GetKeys (ctd::defines::List< std::string > &keys) const
 Generate list of keys defined. More...
 
std::string Print (const HeaderSpecifier print_header=DID_HDR_LAST, const std::string &pattern="", const bool compact=false) const
 Create a DID from the content in the object in a string buffer. More...
 
 Did ()
 
 ~Did ()
 
void Load (const std::string &did_filename, const bool merge=false)
 Load the referenced dictionary. More...
 
void Clear ()
 Clear the object. More...
 
const ctd::defines::List
< std::string > & 
GetDidsLoaded () const
 Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded). More...
 
const ctd::defines::List
< dit::did::Header > & 
GetHeaders () const
 Get the header objects for the DIDs loaded (el [0] = first DID loaded). More...
 
bool HasRecord (const std::string &pattern, const bool allow_idx_subst=true) const
 Check if a record, is contained in the object. More...
 
bool LookUp (const std::string &pattern, dit::did::Record &record, const bool allow_idx_subst=true, const bool exception=true) const
 Look up a key in the DIDs loaded. First occurrence taken. More...
 
void Scan (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool stop_first_match=false, const std::list< std::string > &classes={"*"}, const ctd::defines::DataType data_types=ctd::defines::DATA_TYPE_ALL, const std::string &format_req_ex="*", const std::string &default_value_reg_ex="*", const std::string &unit_reg_ex="*", const std::string &comment_req_ex="*", const std::list< std::string > &tags_reg_ex={"*"}, const std::string &description_req_ex="*") const
 Scan dictionary for key records with the given properties. More...
 
bool LookUp (const std::string &pattern, ctd::defines::List< dit::did::Record > &records, const bool allow_idx_subst=true, const bool exception=false) const
 LookUp Scan the dictionary for keys with the given regular expression pattern. More...
 
void Add (dit::did::Record &record)
 Add a keyword record in the dictionary object. More...
 
void GetKeys (ctd::defines::List< std::string > &keys) const
 Generate list of keys defined. More...
 
std::string Print (const HeaderSpecifier print_header=DID_HDR_LAST, const std::string &pattern="", const bool compact=false) const
 Create a DID from the content in the object in a string buffer. More...
 

Static Public Member Functions

static std::string SubstituteIndeces (const std::string &key)
 Substitutes numeric indeces of keyword components to the generic representation. More...
 
static std::string SubstituteIndex (const std::string &key)
 Substitutes a numeric index of a keyword to obtain the generic representation. More...
 
static std::string SubstituteIndeces (const std::string &key)
 Substitutes numeric indeces of keyword components to the generic representation. More...
 
static std::string SubstituteIndex (const std::string &key)
 Substitutes a numeric index of a keyword to obtain the generic representation. More...
 
static std::string SubstituteIndeces (const std::string &key)
 Substitutes numeric indeces of keyword components to the generic representation. More...
 
static std::string SubstituteIndex (const std::string &key)
 Substitutes a numeric index of a keyword to obtain the generic representation. More...
 

Detailed Description

Data Interface Dictionary class.

Member Enumeration Documentation

Enumerator
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
Enumerator
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
Enumerator
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 
DID_HDR_NONE 
DID_HDR_FIRST 
DID_HDR_LAST 
DID_HDR_ALL 

Constructor & Destructor Documentation

dit::did::Did::Did ( )
dit::did::Did::~Did ( )
dit::did::Did::Did ( )
dit::did::Did::~Did ( )
dit::did::Did::Did ( )
dit::did::Did::~Did ( )

Member Function Documentation

void dit::did::Did::Add ( dit::did::Record record)

Add a keyword record in the dictionary object.

Todo:
Todo:
void dit::did::Did::Add ( dit::did::Record record)

Add a keyword record in the dictionary object.

void dit::did::Did::Add ( dit::did::Record record)

Add a keyword record in the dictionary object.

void dit::did::Did::Clear ( )

Clear the object.

void dit::did::Did::Clear ( )

Clear the object.

void dit::did::Did::Clear ( )

Clear the object.

const ctd::defines::List<std::string>& dit::did::Did::GetDidsLoaded ( ) const

Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).

const ctd::defines::List< std::string > & dit::did::Did::GetDidsLoaded ( ) const

Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).

const ctd::defines::List<std::string>& dit::did::Did::GetDidsLoaded ( ) const

Get the filenames of the DIDs, currently loaded (el [0] = first DID loaded).

const ctd::defines::List<dit::did::Header>& dit::did::Did::GetHeaders ( ) const

Get the header objects for the DIDs loaded (el [0] = first DID loaded).

const ctd::defines::List<dit::did::Header>& dit::did::Did::GetHeaders ( ) const

Get the header objects for the DIDs loaded (el [0] = first DID loaded).

const ctd::defines::List< Header > & dit::did::Did::GetHeaders ( ) const

Get the header objects for the DIDs loaded (el [0] = first DID loaded).

void dit::did::Did::GetKeys ( ctd::defines::List< std::string > &  keys) const

Generate list of keys defined.

void dit::did::Did::GetKeys ( ctd::defines::List< std::string > &  keys) const

Generate list of keys defined.

void dit::did::Did::GetKeys ( ctd::defines::List< std::string > &  keys) const

Generate list of keys defined.

bool dit::did::Did::HasRecord ( const std::string &  pattern,
const bool  allow_idx_subst = true 
) const

Check if a record, is contained in the object.

bool dit::did::Did::HasRecord ( const std::string &  pattern,
const bool  allow_idx_subst = true 
) const

Check if a record, is contained in the object.

bool dit::did::Did::HasRecord ( const std::string &  pattern,
const bool  allow_idx_subst = true 
) const

Check if a record, is contained in the object.

void dit::did::Did::Load ( const std::string &  did_filename,
const bool  merge = false 
)

Load the referenced dictionary.

Parameters
did_filenameName of the file of the dictionary.
clearClear the object before loading. If false, new DIDs are merged.

The filename of the DID shall be given as the relative path, according to the module in which it is residing, e.g.: "<project>/<package>/<module>/MyDid.did". This is the name in the root directory, where the DID is located.

DIDs are searched for in:

  • CFGROOT EXPECT_EQ("", "");
  • INTROOT
  • SYSROOT

in that order.

If DIDs include other DIDs, the last occurrence of a keyword record will take precendence.

void dit::did::Did::Load ( const std::string &  did_filename,
const bool  merge = false 
)

Load the referenced dictionary.

Parameters
did_filenameName of the file of the dictionary.
clearClear the object before loading. If false, new DIDs are merged.

The filename of the DID shall be given as the relative path, according to the module in which it is residing, e.g.: "<project>/<package>/<module>/MyDid.did". This is the name in the root directory, where the DID is located.

DIDs are searched for in:

  • CFGROOT EXPECT_EQ("", "");
  • INTROOT
  • SYSROOT

in that order.

If DIDs include other DIDs, the last occurrence of a keyword record will take precendence.

void dit::did::Did::Load ( const std::string &  did_filename,
const bool  merge = false 
)

Load the referenced dictionary.

Parameters
did_filenameName of the file of the dictionary.
clearClear the object before loading. If false, new DIDs are merged.

The filename of the DID shall be given as the relative path, according to the module in which it is residing, e.g.: "<project>/<package>/<module>/MyDid.did". This is the name in the root directory, where the DID is located.

DIDs are searched for in:

  • CFGROOT EXPECT_EQ("", "");
  • INTROOT
  • SYSROOT

in that order.

If DIDs include other DIDs, the last occurrence of a keyword record will take precendence.

bool dit::did::Did::LookUp ( const std::string &  pattern,
dit::did::Record record,
const bool  allow_idx_subst = true,
const bool  exception = true 
) const

Look up a key in the DIDs loaded. First occurrence taken.

Parameters
patternName of key. May be a regular expression.
recordRecord object, in which the information about the key will be stored.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if a record matched.
bool dit::did::Did::LookUp ( const std::string &  pattern,
dit::did::Record record,
const bool  allow_idx_subst = true,
const bool  exception = true 
) const

Look up a key in the DIDs loaded. First occurrence taken.

Parameters
patternName of key. May be a regular expression.
recordRecord object, in which the information about the key will be stored.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if a record matched.
bool dit::did::Did::LookUp ( const std::string &  pattern,
dit::did::Record record,
const bool  allow_idx_subst = true,
const bool  exception = true 
) const

Look up a key in the DIDs loaded. First occurrence taken.

Parameters
patternName of key. May be a regular expression.
recordRecord object, in which the information about the key will be stored.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if a record matched.
bool dit::did::Did::LookUp ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  exception = false 
) const

LookUp Scan the dictionary for keys with the given regular expression pattern.

Parameters
patternName of key. May be a regular expression.
recordsList with record objects of keys matching.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if at least one key matched the reg ex.
bool dit::did::Did::LookUp ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  exception = false 
) const

LookUp Scan the dictionary for keys with the given regular expression pattern.

Parameters
patternName of key. May be a regular expression.
recordsList with record objects of keys matching.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if at least one key matched the reg ex.
bool dit::did::Did::LookUp ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  exception = false 
) const

LookUp Scan the dictionary for keys with the given regular expression pattern.

Parameters
patternName of key. May be a regular expression.
recordsList with record objects of keys matching.
allow_idx_substIf true, indeces may be substituted with #'s.
exceptionIf true, an exception is thrown if no key matching was found.
Returns
True if at least one key matched the reg ex.
std::string dit::did::Did::Print ( const HeaderSpecifier  print_header = DID_HDR_LAST,
const std::string &  pattern = "",
const bool  compact = false 
) const

Create a DID from the content in the object in a string buffer.

Parameters
print_headerIndicates which header(s) to print.
patternIf specified, print only the keys matching (may be regular expression).
Returns
Buffer with the generated DID.
std::string dit::did::Did::Print ( const HeaderSpecifier  print_header = DID_HDR_LAST,
const std::string &  pattern = "",
const bool  compact = false 
) const

Create a DID from the content in the object in a string buffer.

Parameters
print_headerIndicates which header(s) to print.
patternIf specified, print only the keys matching (may be regular expression).
Returns
Buffer with the generated DID.
std::string dit::did::Did::Print ( const HeaderSpecifier  print_header = DID_HDR_LAST,
const std::string &  pattern = "",
const bool  compact = false 
) const

Create a DID from the content in the object in a string buffer.

Parameters
print_headerIndicates which header(s) to print.
patternIf specified, print only the keys matching (may be regular expression).
Returns
Buffer with the generated DID.
void dit::did::Did::Scan ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  stop_first_match = false,
const std::list< std::string > &  classes = {"*"},
const ctd::defines::DataType  data_types = ctd::defines::DATA_TYPE_ALL,
const std::string &  format_req_ex = "*",
const std::string &  default_value_reg_ex = "*",
const std::string &  unit_reg_ex = "*",
const std::string &  comment_req_ex = "*",
const std::list< std::string > &  tags_reg_ex = {"*"},
const std::string &  description_req_ex = "*" 
) const

Scan dictionary for key records with the given properties.

Parameters
patternRegular expression used for matching the keys.
recordsList to hold the information for the records matching.
allow_idx_substIf true, indeces may be substituted with #'s.
stop_first_matchStop scanning at first match.
classesKeyword classes to match.
data_typesData types to consider.
format_req_exRegular expression to apply on the format.
default_value_reg_exRegular expression to apply on the default value.
unit_reg_exRegular expression to apply on the unit.
comment_req_exRegular expression to apply on the comment.
tagsRegular expressions to apply on the tags specified.
description_req_exRegular expression to apply on the description.
void dit::did::Did::Scan ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  stop_first_match = false,
const std::list< std::string > &  classes = {"*"},
const ctd::defines::DataType  data_types = ctd::defines::DATA_TYPE_ALL,
const std::string &  format_req_ex = "*",
const std::string &  default_value_reg_ex = "*",
const std::string &  unit_reg_ex = "*",
const std::string &  comment_req_ex = "*",
const std::list< std::string > &  tags_reg_ex = {"*"},
const std::string &  description_req_ex = "*" 
) const

Scan dictionary for key records with the given properties.

Parameters
patternRegular expression used for matching the keys.
recordsList to hold the information for the records matching.
allow_idx_substIf true, indeces may be substituted with #'s.
stop_first_matchStop scanning at first match.
classesKeyword classes to match.
data_typesData types to consider.
format_req_exRegular expression to apply on the format.
default_value_reg_exRegular expression to apply on the default value.
unit_reg_exRegular expression to apply on the unit.
comment_req_exRegular expression to apply on the comment.
tagsRegular expressions to apply on the tags specified.
description_req_exRegular expression to apply on the description.
void dit::did::Did::Scan ( const std::string &  pattern,
ctd::defines::List< dit::did::Record > &  records,
const bool  allow_idx_subst = true,
const bool  stop_first_match = false,
const std::list< std::string > &  classes = {"*"},
const ctd::defines::DataType  data_types = ctd::defines::DATA_TYPE_ALL,
const std::string &  format_req_ex = "*",
const std::string &  default_value_reg_ex = "*",
const std::string &  unit_reg_ex = "*",
const std::string &  comment_req_ex = "*",
const std::list< std::string > &  tags_reg_ex = {"*"},
const std::string &  description_req_ex = "*" 
) const

Scan dictionary for key records with the given properties.

Parameters
patternRegular expression used for matching the keys.
recordsList to hold the information for the records matching.
allow_idx_substIf true, indeces may be substituted with #'s.
stop_first_matchStop scanning at first match.
classesKeyword classes to match.
data_typesData types to consider.
format_req_exRegular expression to apply on the format.
default_value_reg_exRegular expression to apply on the default value.
unit_reg_exRegular expression to apply on the unit.
comment_req_exRegular expression to apply on the comment.
tagsRegular expressions to apply on the tags specified.
description_req_exRegular expression to apply on the description.
Todo:
Implement.
Todo:
Implement.
static std::string dit::did::Did::SubstituteIndeces ( const std::string &  key)
static

Substitutes numeric indeces of keyword components to the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>][.<str>[<nb>]" or "<str>[<nb>][ <str>[<nb>]" (latter space vs dot separated keyword components) to obtain the generic 'DID representation' for indeces: "<str>[#][.<str>[#]".

Returns
Processed key or the input key, if no processing was done.
std::string dit::did::Did::SubstituteIndeces ( const std::string &  key)
static

Substitutes numeric indeces of keyword components to the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>][.<str>[<nb>]" or "<str>[<nb>][ <str>[<nb>]" (latter space vs dot separated keyword components) to obtain the generic 'DID representation' for indeces: "<str>[#][.<str>[#]".

Returns
Processed key or the input key, if no processing was done.
static std::string dit::did::Did::SubstituteIndeces ( const std::string &  key)
static

Substitutes numeric indeces of keyword components to the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>][.<str>[<nb>]" or "<str>[<nb>][ <str>[<nb>]" (latter space vs dot separated keyword components) to obtain the generic 'DID representation' for indeces: "<str>[#][.<str>[#]".

Returns
Processed key or the input key, if no processing was done.
static std::string dit::did::Did::SubstituteIndex ( const std::string &  key)
static

Substitutes a numeric index of a keyword to obtain the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".

Returns
Processed key or the input key, if no processing was done.
static std::string dit::did::Did::SubstituteIndex ( const std::string &  key)
static

Substitutes a numeric index of a keyword to obtain the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".

Returns
Processed key or the input key, if no processing was done.
std::string dit::did::Did::SubstituteIndex ( const std::string &  key)
static

Substitutes a numeric index of a keyword to obtain the generic representation.

Parameters
keyKey to be processed.

The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".

Returns
Processed key or the input key, if no processing was done.

The documentation for this class was generated from the following files: