|
ifw-ccf
3.0.0-pre2
|
Implements a name mapping service, based on a Name Mapping File to be loaded and installed. More...
#include <nameMapping.hpp>
Public Member Functions | |
| NameMapping () | |
| ~NameMapping () | |
| virtual void | Load (const std::string &name_mapping) |
| Load the given Name Mapping. More... | |
| 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. More... | |
| 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. More... | |
| const std::map< std::string, std::string > & | GetSecondaryToPrimaryMap () const |
| Return the reference to the Secondary to Primary name map. More... | |
| std::string | ToString () const |
| Generate a sumamry string status of the object. More... | |
Public Member Functions inherited from ccf::Base | |
| Base () | |
| ~Base () | |
| const std::string & | GetClassName () const |
| Return the allocated name of the class. More... | |
| log4cplus::Logger & | Loggger () |
| Return reference to logger used in this context. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ccf::Base | |
| static ccf::mptk::Manager & | Mptk () |
| Return reference to internal MPTK instance (singleton). More... | |
| static void | SetLogLevel (const ccf::LogLevel log_level) |
| Set the log level. More... | |
| static ccf::LogLevel | GetLogLevel () |
| Return the current CCF log level. More... | |
Protected Member Functions inherited from ccf::Base | |
| void | SetClassName (const std::string &class_name) |
| Set the name of the class in question. More... | |
| void | SetLogger (log4cplus::Logger &logger) |
| Set reference to logger used in this context. More... | |
Protected Attributes inherited from ccf::Base | |
| log4cplus::Logger | m_logger |
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) ...
| ccf::common::NameMapping::NameMapping | ( | ) |
| ccf::common::NameMapping::~NameMapping | ( | ) |
| void 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.
| const std::string & 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.
| const std::map< std::string, std::string > & ccf::common::NameMapping::GetPrimaryToSecondaryMap | ( | ) | const |
Return the reference to the Primary to Secondary name map.
| std::string 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.
| const std::map< std::string, std::string > & ccf::common::NameMapping::GetSecondaryToPrimaryMap | ( | ) | const |
Return the reference to the Secondary to Primary name map.
| bool ccf::common::NameMapping::HasNameMapping | ( | const std::string & | name | ) | const |
Return true if a mapping is defined for the given parameter.
|
virtual |
Load the given Name Mapping.
| std::string ccf::common::NameMapping::ToString | ( | ) | const |
Generate a sumamry string status of the object.