Implements a name mapping service, based on a Name Mapping File to be loaded and installed.
More...
#include <nameMapping.hpp>
|
| NameMapping () |
|
| ~NameMapping () |
|
virtual void | Load (const std::string &name_mapping) |
| Load the given Name Mapping.
|
|
void | AddNameMapping (const std::string &primary_name, const std::string &secondary_name) |
|
bool | HasNameMapping (const std::string &name) const |
| Return true if a mapping is defined for the given parameter.
|
|
std::vector< std::string > | GetPossibleNames (const std::string &name) const |
| Return various possible names based on the name given as input.
|
|
const std::string & | GetPrimaryName (const std::string &secondary_name, const bool tolerant=true) const |
|
std::string | GetSecondaryName (const std::string &primary_name, const bool tolerant=true) const |
|
const std::map< std::string, std::string > & | GetPrimaryToSecondaryMap () const |
| Return the reference to the Primary to Secondary name map.
|
|
const std::map< std::string, std::string > & | GetSecondaryToPrimaryMap () const |
| Return the reference to the Secondary to Primary name map.
|
|
std::string | ToString () const |
| Generate a sumamry string status of the object.
|
|
ParameterProperty | GetParameterProperty (const std::string &secondary_name) const |
| Return the property of a command low level name, default to {UNDEFINED, String}.
|
|
| Base () |
|
| ~Base () |
|
const std::string & | GetClassName () const |
| Return the allocated name of the class.
|
|
Implements a name mapping service, based on a Name Mapping File to be loaded and installed.
The class is used to handle mapping between Secondary and Primary Names. Could e.g. be mapping between a software internal name and the names at device level. The default format for Mapping Files is YAML defined as:
(primary name): (secondary name) ...
◆ NameMapping()
ifw::ccf::common::NameMapping::NameMapping |
( |
| ) |
|
◆ ~NameMapping()
ifw::ccf::common::NameMapping::~NameMapping |
( |
| ) |
|
◆ AddNameMapping()
void ifw::ccf::common::NameMapping::AddNameMapping |
( |
const std::string & | primary_name, |
|
|
const std::string & | secondary_name ) |
Add a Name Mapping in the object. If "replace" is true, an existing mapping will be replaced silently.
◆ GetParameterProperty()
Return the property of a command low level name, default to {UNDEFINED, String}.
◆ GetPossibleNames()
std::vector< std::string > ifw::ccf::common::NameMapping::GetPossibleNames |
( |
const std::string & | name | ) |
const |
Return various possible names based on the name given as input.
- Parameters
-
- Returns
- List with various options.
◆ GetPrimaryName()
const std::string & ifw::ccf::common::NameMapping::GetPrimaryName |
( |
const std::string & | secondary_name, |
|
|
const bool | tolerant = true ) const |
Map the given Secondary Name into the corresponding Primary Name. If "tolerant" is true, if no mapping is found, the Secondary Name is returned as is.
◆ GetPrimaryToSecondaryMap()
const std::map< std::string, std::string > & ifw::ccf::common::NameMapping::GetPrimaryToSecondaryMap |
( |
| ) |
const |
Return the reference to the Primary to Secondary name map.
◆ GetSecondaryName()
std::string ifw::ccf::common::NameMapping::GetSecondaryName |
( |
const std::string & | primary_name, |
|
|
const bool | tolerant = true ) const |
Map the given Primary Name into the corresponding Secondary Name. If "tolerant" is true, if no mapping is found, the Primary Name is returned as is.
◆ GetSecondaryToPrimaryMap()
const std::map< std::string, std::string > & ifw::ccf::common::NameMapping::GetSecondaryToPrimaryMap |
( |
| ) |
const |
Return the reference to the Secondary to Primary name map.
◆ HasNameMapping()
bool ifw::ccf::common::NameMapping::HasNameMapping |
( |
const std::string & | name | ) |
const |
Return true if a mapping is defined for the given parameter.
◆ Load()
void ifw::ccf::common::NameMapping::Load |
( |
const std::string & | name_mapping | ) |
|
|
virtual |
Load the given Name Mapping.
◆ ToString()
std::string ifw::ccf::common::NameMapping::ToString |
( |
| ) |
const |
Generate a sumamry string status of the object.
The documentation for this class was generated from the following files: