ifw
0.0.1-dev
|
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... | |
Data Interface Dictionary class.
dit::did::Did::Did | ( | ) |
dit::did::Did::~Did | ( | ) |
dit::did::Did::Did | ( | ) |
dit::did::Did::~Did | ( | ) |
dit::did::Did::Did | ( | ) |
dit::did::Did::~Did | ( | ) |
void dit::did::Did::Add | ( | dit::did::Record & | record | ) |
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.
Load the referenced dictionary.
did_filename | Name of the file of the dictionary. |
clear | Clear 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:
in that order.
If DIDs include other DIDs, the last occurrence of a keyword record will take precendence.
Load the referenced dictionary.
did_filename | Name of the file of the dictionary. |
clear | Clear 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:
in that order.
If DIDs include other DIDs, the last occurrence of a keyword record will take precendence.
Load the referenced dictionary.
did_filename | Name of the file of the dictionary. |
clear | Clear 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:
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.
pattern | Name of key. May be a regular expression. |
record | Record object, in which the information about the key will be stored. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
pattern | Name of key. May be a regular expression. |
record | Record object, in which the information about the key will be stored. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
pattern | Name of key. May be a regular expression. |
record | Record object, in which the information about the key will be stored. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
pattern | Name of key. May be a regular expression. |
records | List with record objects of keys matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
pattern | Name of key. May be a regular expression. |
records | List with record objects of keys matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
pattern | Name of key. May be a regular expression. |
records | List with record objects of keys matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
exception | If true, an exception is thrown if no key matching was found. |
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.
print_header | Indicates which header(s) to print. |
pattern | If specified, print only the keys matching (may be regular expression). |
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.
print_header | Indicates which header(s) to print. |
pattern | If specified, print only the keys matching (may be regular expression). |
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.
print_header | Indicates which header(s) to print. |
pattern | If specified, print only the keys matching (may be regular expression). |
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.
pattern | Regular expression used for matching the keys. |
records | List to hold the information for the records matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
stop_first_match | Stop scanning at first match. |
classes | Keyword classes to match. |
data_types | Data types to consider. |
format_req_ex | Regular expression to apply on the format. |
default_value_reg_ex | Regular expression to apply on the default value. |
unit_reg_ex | Regular expression to apply on the unit. |
comment_req_ex | Regular expression to apply on the comment. |
tags | Regular expressions to apply on the tags specified. |
description_req_ex | Regular 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.
pattern | Regular expression used for matching the keys. |
records | List to hold the information for the records matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
stop_first_match | Stop scanning at first match. |
classes | Keyword classes to match. |
data_types | Data types to consider. |
format_req_ex | Regular expression to apply on the format. |
default_value_reg_ex | Regular expression to apply on the default value. |
unit_reg_ex | Regular expression to apply on the unit. |
comment_req_ex | Regular expression to apply on the comment. |
tags | Regular expressions to apply on the tags specified. |
description_req_ex | Regular 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.
pattern | Regular expression used for matching the keys. |
records | List to hold the information for the records matching. |
allow_idx_subst | If true, indeces may be substituted with #'s. |
stop_first_match | Stop scanning at first match. |
classes | Keyword classes to match. |
data_types | Data types to consider. |
format_req_ex | Regular expression to apply on the format. |
default_value_reg_ex | Regular expression to apply on the default value. |
unit_reg_ex | Regular expression to apply on the unit. |
comment_req_ex | Regular expression to apply on the comment. |
tags | Regular expressions to apply on the tags specified. |
description_req_ex | Regular expression to apply on the description. |
|
static |
Substitutes numeric indeces of keyword components to the generic representation.
key | Key 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>[#]".
|
static |
Substitutes numeric indeces of keyword components to the generic representation.
key | Key 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>[#]".
|
static |
Substitutes numeric indeces of keyword components to the generic representation.
key | Key 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>[#]".
|
static |
Substitutes a numeric index of a keyword to obtain the generic representation.
key | Key to be processed. |
The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".
|
static |
Substitutes a numeric index of a keyword to obtain the generic representation.
key | Key to be processed. |
The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".
|
static |
Substitutes a numeric index of a keyword to obtain the generic representation.
key | Key to be processed. |
The method checks a keyword of the form "<str>[<nb>] to obtain the generic 'DID representation' for indeces: "<str>[#]".