ADTF
3.18.2
|
MapEnumTableTransformation represents a transformation between to enumerations. More...
Public Types | |
using | ConversionMap = std::map< int64_t, int64_t > |
Alias for the conversion map. | |
Public Member Functions | |
MapEnumTableTransformation (MapConfiguration *config, const std::string &name) | |
CTOR. More... | |
const std::string & | getEnumFrom () const |
Returns the name of the source enumeration. | |
const std::string & | getEnumTo () const |
Returns the name of the target enumeration. | |
a_util::result::Result | setEnums (const std::string &enum_from, const std::string &enum_to) |
Set the name of the target and source enumerations. More... | |
int64_t | getDefault () const |
Returns default value. | |
std::string | getDefaultStr () const |
Returns default value as string. | |
a_util::result::Result | setDefault (const std::string &default_value) |
Set default value as string. More... | |
const ConversionMap & | getConversions () const |
Returns conversion list. | |
const std::map< std::string, std::string > & | getConversionsStr () const |
Returns conversion list as string. | |
a_util::result::Result | addConversion (const std::string &from, const std::string &to) |
Add a conversion as string. More... | |
a_util::result::Result | removeConversion (const std::string &from) |
Remove a conversion as string. More... | |
bool | isEqual (const MapTransformationBase &other) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
double | evaluate (double value) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
MapTransformationBase * | clone () const |
nodoc | |
Public Member Functions inherited from MapTransformationBase | |
MapTransformationBase (MapConfiguration *config, const std::string &name) | |
CTOR. More... | |
virtual | ~MapTransformationBase () |
DTOR. | |
const std::string & | getName () const |
Returns the name of the transformation. | |
bool | isValid () const |
Returns the validity for the current description. | |
Private Types | |
typedef std::map< std::string, std::string > | MapStrConversionList |
Private Member Functions | |
a_util::result::Result | loadFromDom (const a_util::xml::DOMElement &dom_element) |
Initializes the transformation from a target-dom element. More... | |
a_util::result::Result | writeToDOM (a_util::xml::DOMElement &dom_element) const |
Export transformation to a XML dom element. More... | |
a_util::result::Result | convertValuesWithDDL () |
Convert string values to integer values. More... | |
a_util::result::Result | setEnumsStr (const std::string &enum_from, const std::string &enum_to) |
Set the name of the target and source enumerations. More... | |
a_util::result::Result | setDefaultStr (const std::string &default_value) |
Set default value as string. More... | |
a_util::result::Result | addConversionStr (const std::string &from, const std::string &to) |
Add a conversion as string. More... | |
Private Attributes | |
std::string | _enum_from |
std::string | _enum_to |
std::string | _default_value |
MapStrConversionList | _conversions |
int64_t | _default_int |
ConversionMap | _conversions_int |
MapEnumTableTransformation represents a transformation between to enumerations.
Definition at line 203 of file map_transformation.h.
MapEnumTableTransformation | ( | MapConfiguration * | config, |
const std::string & | name | ||
) |
CTOR.
[in] | config | The configuration |
[in] | name | The transformation name |
a_util::result::Result addConversion | ( | const std::string & | from, |
const std::string & | to | ||
) |
Add a conversion as string.
[in] | from | string for source value |
[in] | to | string for target value |
a_util::result::SUCCESS | Everything went fine |
|
private |
Add a conversion as string.
[in] | from | string for source value |
[in] | to | string for target value |
a_util::result::SUCCESS | Everything went fine |
|
private |
Convert string values to integer values.
The integer values were not filled before, as the ddl is necessary for this
ERR_INVALID_TYPE | Inconsistency with ddl |
a_util::result::SUCCESS | Everything went fine |
|
private |
Initializes the transformation from a target-dom element.
[in] | dom_element | The dom element from which to import |
ERR_INVALID_ARG | Missing attribute |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result removeConversion | ( | const std::string & | from | ) |
Remove a conversion as string.
[in] | from | string for source value |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setDefault | ( | const std::string & | default_value | ) |
Set default value as string.
[in] | default_value | string for default value |
a_util::result::SUCCESS | Everything went fine |
|
private |
Set default value as string.
[in] | default_value | string for default value |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setEnums | ( | const std::string & | enum_from, |
const std::string & | enum_to | ||
) |
Set the name of the target and source enumerations.
[in] | enum_from | input enumeration name |
[in] | enum_to | output enumeration name |
ERR_INVALID_TYPE | Enums not found in ddl |
a_util::result::SUCCESS | Everything went fine |
|
private |
Set the name of the target and source enumerations.
[in] | enum_from | input enumeration name |
[in] | enum_to | output enumeration name |
a_util::result::SUCCESS | Everything went fine |
|
private |
Export transformation to a XML dom element.
[in] | dom_element | The dom element to be written |
a_util::result::SUCCESS | Everything went fine |