ifw-ccf 6.0.0
 
Loading...
Searching...
No Matches
nameMapping.hpp
Go to the documentation of this file.
1
6
7#ifndef CCF_COMMON_NAME_MAPPING_HPP_H_
8#define CCF_COMMON_NAME_MAPPING_HPP_H_
9
10#include <ifw/fnd/defs/dataType.hpp>
11
13#include <ifw/ccf/common/db.hpp>
14
15
16namespace ifw::ccf::common {
17
27 public:
28
34 std::string m_default_value;
35 ifw::fnd::datatype::DataType m_data_type;
36 };
37
40
42 virtual void Load(const std::string& name_mapping);
43
46 void AddNameMapping(const std::string& primary_name,
47 const std::string& secondary_name);
48
50 bool HasNameMapping(const std::string& name) const;
51
55 std::vector<std::string> GetPossibleNames(const std::string& name) const;
56
59 const std::string& GetPrimaryName(const std::string& secondary_name,
60 const bool tolerant = true) const;
61
64 std::string GetSecondaryName(const std::string& primary_name,
65 const bool tolerant = true) const;
66
68 const std::map<std::string, std::string>& GetPrimaryToSecondaryMap() const;
69
71 const std::map<std::string, std::string>& GetSecondaryToPrimaryMap() const;
72
74 std::string ToString() const;
75
77 ParameterProperty GetParameterProperty(const std::string& secondary_name) const;
78
79 private:
80 std::string m_mapping_file;
81 std::map<std::string, std::string> m_prim_to_sec_name_map;
82 std::map<std::string, std::string> m_sec_to_prim_name_map;
83 std::map<std::string, ParameterProperty> m_sec_to_default;
84 };
85
86}
87
88#endif // CCF_COMMON_NAME_MAPPING_HPP_H_
Class to be used as parent all CCF classes.
Definition base.hpp:122
bool HasNameMapping(const std::string &name) const
Return true if a mapping is defined for the given parameter.
Definition nameMapping.cpp:102
const std::map< std::string, std::string > & GetPrimaryToSecondaryMap() const
Return the reference to the Primary to Secondary name map.
Definition nameMapping.cpp:155
~NameMapping()
Definition nameMapping.cpp:19
std::string ToString() const
Generate a sumamry string status of the object.
Definition nameMapping.cpp:114
const std::map< std::string, std::string > & GetSecondaryToPrimaryMap() const
Return the reference to the Secondary to Primary name map.
Definition nameMapping.cpp:160
void AddNameMapping(const std::string &primary_name, const std::string &secondary_name)
Definition nameMapping.cpp:60
virtual void Load(const std::string &name_mapping)
Load the given Name Mapping.
Definition nameMapping.cpp:23
std::vector< std::string > GetPossibleNames(const std::string &name) const
Return various possible names based on the name given as input.
Definition nameMapping.cpp:86
std::string GetSecondaryName(const std::string &primary_name, const bool tolerant=true) const
Definition nameMapping.cpp:124
const std::string & GetPrimaryName(const std::string &secondary_name, const bool tolerant=true) const
Definition nameMapping.cpp:141
ParameterProperty GetParameterProperty(const std::string &secondary_name) const
Return the property of a command low level name, default to {UNDEFINED, String}.
Definition nameMapping.cpp:165
NameMapping()
Definition nameMapping.cpp:15
Definition appBase.cpp:10
std::string m_default_value
Definition nameMapping.hpp:34
ifw::fnd::datatype::DataType m_data_type
Definition nameMapping.hpp:35