ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ifw::ccf::common::NameMapping Class Reference

Implements a name mapping service, based on a Name Mapping File to be loaded and installed. More...

#include <nameMapping.hpp>

Inheritance diagram for ifw::ccf::common::NameMapping:
ifw::ccf::Base

Classes

struct  ParameterProperty
 

Public Member Functions

 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}.
 
- Public Member Functions inherited from ifw::ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class.
 

Additional Inherited Members

- Static Public Member Functions inherited from ifw::ccf::Base
static ifw::ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton).
 
- Protected Member Functions inherited from ifw::ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question.
 

Detailed Description

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) ...

Constructor & Destructor Documentation

◆ NameMapping()

ifw::ccf::common::NameMapping::NameMapping ( )

◆ ~NameMapping()

ifw::ccf::common::NameMapping::~NameMapping ( )

Member Function Documentation

◆ 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()

NameMapping::ParameterProperty ifw::ccf::common::NameMapping::GetParameterProperty ( const std::string & secondary_name) const

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
nameParameter name.
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: