ADTF
ddl::mapping Namespace Reference

definition of the mapping namespace More...

Namespaces

 oo
 definition of the dd namespace for mapping
 
 rt
 definition of the rt namespace for mapping
 

Classes

struct  MappingConfigurationFromXMLFactory
 Factory to create a MappingConfiguration out of a XML based description. More...
 
struct  MappingConfigurationFromXMLFactory10
 Factory to create a MappingConfiguration out of a XML based description. More...
 
struct  MappingConfigurationFromXMLFactoryBase
 Factory helper to create a MappingConfiguration out of a XML based description. More...
 
struct  MappingConfigurationToXMLFactory
 Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType. More...
 
struct  MappingConfigurationToXMLFactory10
 Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType. More...
 
struct  MappingConfigurationToXMLFactoryBase
 Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType. More...
 
class  DDLEnumTableFunction
 Enum Table function with type string "ddl_enum_table". More...
 
class  InlinePolynomialFunction
 Inline Polynomial function with type string "inline_polynomial". More...
 
class  TriggerCounterFunction
 Trigger counter function to retrieve the current count of a certain trigger fired. More...
 
class  WasReceivedFunction
 Was received function to retrieve if at least the given source with name was received. More...
 
class  PolynomialFunction
 Polynomial function with type string "polynomial". More...
 
class  SimulationTimeFunction
 Simulation time function to retrieve the last known simulation time updated by time trigger. More...
 
class  SimulationTimeFunctionFactory
 Factory for SimulationTimeFunction as type "simulation_time". More...
 
class  MapAssignment
 MapAssignment. More...
 
class  MapConfiguration
 MapConfiguration is the central class of the mapping::dd namespace. More...
 
class  MapHeader
 MapHeader contains all information from the header-Tag of a mapping configuration. More...
 
class  MapSource
 MapSource represents a mapping source from the configuration file. More...
 
class  MapTarget
 MapTarget represents a mapped target from the mapping configuration. More...
 
class  MapTransformationBase
 cMapTransformation forms a base class for a single transformation More...
 
class  MapPolynomTransformation
 MapPolynomTransformation represents a polynom transformation in the configuration api as well as the actual implementation of the transformation in the evaluate method. More...
 
class  MapEnumTableTransformation
 MapEnumTableTransformation represents a transformation between to enumerations. More...
 
class  MapTriggerBase
 cMapTrigger forms a base class for a trigger contained in the configuration More...
 
class  MapPeriodicTrigger
 implementation of a periodic trigger in the configuration api More...
 
class  MapSignalTrigger
 implementation of a signal trigger in the configuration api More...
 
class  MapDataTrigger
 implementation of a data trigger in the configuration api More...
 
class  Mapper
 The mapper to create the targets from sources. More...
 
class  MapperElementBase
 Mapper Element base template. More...
 
class  SourceFactoryImplementation
 SourceFactory implementation template. More...
 
class  TargetFactoryImplementation
 TargetFactory implementation template. More...
 
class  FunctionFactoryImplementation
 FunctionFactory implementation template. More...
 
class  ConstantValueFactory
 Constant value factory to create a constant numeric value of value. More...
 
class  SourceValue
 Source Value base class. More...
 
class  PlainSourceValue
 Value getter to retrieve a value with plain type content. More...
 
class  ArraySourceValue
 Source Value base class that represents an array. More...
 
class  TargetValue
 Value setter to set a value. More...
 
class  Property
 Property class representing a pair of value and its type. More...
 
class  MapperElement
 Mapper Element. More...
 
class  Updateable
 Updateable interface class. More...
 
class  Source
 Mapping Source base class. More...
 
class  Memory
 Memory base class for sources and targets representing a continous memory buffer. More...
 
class  MemorySource
 Source memory base class for sources representing a continuous memory buffer. More...
 
class  MapperFactory
 A mapper factory to create Source, Target or Function. More...
 
class  SpecificMapperFactory
 A specific mapper factory to create Source, Target or Function. More...
 
class  Target
 Mapping Target base class. More...
 
class  MemoryTarget
 Memory Target base class that represents a continuous memory buffer. More...
 
class  Function
 Mapping Function base class. More...
 
class  AssignmentTrigger
 Trigger interface to trigger the assignments of a specific target. More...
 
class  MappingConfiguration
 Mapping Configuration model with validation and requirements management. More...
 
class  DDLSource
 DDLSource implementation class representing a MemorySource that provides named source values for ddl based decoding. More...
 
class  DDLTarget
 DDLTarget implementation class representing a MemoryTarget that provides named target values for ddl based encoding. More...
 
class  MapperFactories
 Mapping factory collection class registry. More...
 
class  Engine
 Mapping engine base class. More...
 
class  DefaultEngine
 Default engine implementation. More...
 
class  MappingFile
 Convenience class to load and validate a MappingConfiguration from a xml file string. More...
 
class  MappingString
 Convenience class to load and validate a MappingConfiguration from a xml string. More...
 
class  Version
 Mapping Version. More...
 

Typedefs

typedef std::vector< std::string > MapErrorList
 container type for mapping errors
 
typedef std::vector< MapAssignmentMapAssignmentList
 Public composite types used in the mapping::dd namespace.
 
typedef std::vector< MapSourceMapSourceList
 Public composite types used in the mapping::dd namespace.
 
typedef std::set< std::string > MapSourceNameList
 defintion of MapSource name list
 
typedef std::vector< MapTargetMapTargetList
 Public composite types used in the mapping::dd namespace.
 
typedef std::vector< MapTransformationBase * > MapTransformationList
 Public composite types used in the mapping::dd namespace.
 
typedef std::vector< MapTriggerBase * > MapTriggerList
 Public composite types used in the mapping::dd namespace.
 
typedef std::map< std::string, uint8_t > TypeMap
 String -> Datatype Enum Map.
 
using ValueVariant = std::variant< uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, bool >
 Variant Value to retrieve a plain type value of a source.
 
using Properties = std::unordered_map< std::string, Property >
 Properties class as set of key - property value pairs This proerties are used to adjust the readers and propcessors behaviour.
 
using SourceFactory = SpecificMapperFactory< Source >
 A Source factory to create a Source.
 
using TargetFactory = SpecificMapperFactory< Target >
 A Target factory to create a Target.
 
using FunctionFactory = SpecificMapperFactory< Function >
 A Function factory to create a Function.
 
using Error = ddl::utility::Error
 mapping error definition
 
using Problem = ddl::utility::Problem
 defintion of problems for validation of the MappingConfiguration
 
using Requirement = ddl::utility::VersionRequirement< Version >
 mapping version requirements
 
using VersionConversion = ddl::dd::VersionConversion
 Resuse of ddl Version conversion utility class for mapping version.
 

Enumerations

enum  DataTypes {
  e_uint8 = 1 , e_uint16 , e_uint32 , e_uint64 ,
  e_int8 , e_int16 , e_int32 , e_int64 ,
  e_float32 , e_float64 , e_bool , e_char
}
 Enum for all relevant data types.
 
enum class  ValidationLevel : uint8_t { dont_know , invalid , good_enough , valid }
 MappingConfiguration validation level. More...
 

Functions

std::string getMapping10FunctionCallAttributes (const datamodel::Assignment &assignment, [[maybe_unused]] const std::string &current_target_name, const datamodel::MappingConfiguration::Functions &functions, std::vector< std::pair< std::string, std::string >> &attributes_to_set)
 Get the Mapping10 Module Call Attributes. More...
 
bool operator== (const MapAssignment &a, const MapAssignment &b)
 compares the Assignments More...
 
bool operator!= (const MapAssignment &a, const MapAssignment &b)
 compares the Assignments More...
 
bool operator== (const MapSource &a, const MapSource &b)
 compares MapSources in type and name More...
 
bool operator!= (const MapSource &a, const MapSource &b)
 compares MapSources in type and name More...
 
bool operator== (const MapTarget &a, const MapTarget &b)
 compares the targets More...
 
bool operator!= (const MapTarget &a, const MapTarget &b)
 compares the targets More...
 
template<typename T >
void getValueRef (const ValueVariant &value, T &value_reference)
 Get the value from a variant as plain type T. More...
 
template<typename T >
getValue (const ValueVariant &value)
 Get the value. More...
 
bool operator== (const Property &left, const Property &right)
 compare operator for Property More...
 
Properties operator+ (const Properties &properties_left, const Properties &properties_right)
 Add operator for properties. More...
 
std::vector< std::string > transformValidationProblemList (const std::vector< Problem > &problems)
 transforms the validation protocol of problems to a simple vector of strings. More...
 
MapperFactories getDefaultMapperFactories ()
 Retrieves the default mapper factories This contains: More...
 

Detailed Description

definition of the mapping namespace

Enumeration Type Documentation

◆ ValidationLevel

enum ValidationLevel : uint8_t
strong

MappingConfiguration validation level.

Enumerator
dont_know 

The validation is not known.

This means there was no validation.

invalid 

the validation level is invalid.

good_enough 

the mapping is valid for running at engine, but has problems

valid 

every thing is well defined.

Definition at line 40 of file mapping_configuration_types.h.

Function Documentation

◆ getDefaultMapperFactories()

MapperFactories ddl::mapping::getDefaultMapperFactories ( )

Retrieves the default mapper factories This contains:

◆ getMapping10FunctionCallAttributes()

std::string ddl::mapping::getMapping10FunctionCallAttributes ( const datamodel::Assignment assignment,
[[maybe_unused] ] const std::string &  current_target_name,
const datamodel::MappingConfiguration::Functions functions,
std::vector< std::pair< std::string, std::string >> &  attributes_to_set 
)
inline

Get the Mapping10 Module Call Attributes.

Remarks
this is a DOM independent function to reuse within requirements model of the MappingConfiguration!
Parameters
assignmentthe assignemnt to serialize
current_target_namethe current target the assignment belongs to
functionsthe "functions" node
attributes_to_setthe resulting attributes to set
Returns
std::string error message return value, if empty no error occured

Definition at line 45 of file datamodel_xml_configurationtoxml_10.h.

References TypeAccessList< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::get(), Assignment::getFunctionCall(), Assignment::getParameterValues(), ddl::dd::utility::isInteger(), and ParameterValue::source_value.

Referenced by MappingConfigurationToXMLFactory10< DomNodeType >::resolveFunctionCall().

◆ getValue()

T ddl::mapping::getValue ( const ValueVariant value)

Get the value.

Template Parameters
TThe type to convert the value to
Returns
T The value retrieved

Definition at line 70 of file mapper_interfaces.h.

◆ getValueRef()

void ddl::mapping::getValueRef ( const ValueVariant value,
T &  value_reference 
)

Get the value from a variant as plain type T.

Template Parameters
Tthe type of the value to retrieve and convert
Parameters
valuethe variant value
value_referencethe value reference to retrieve and convert to

Definition at line 57 of file mapper_interfaces.h.

Referenced by PlainSourceValue::getValueOrDefaultRef(), and PlainSourceValue::getValueRef().

◆ operator!=() [1/3]

bool ddl::mapping::operator!= ( const MapAssignment a,
const MapAssignment b 
)
inline

compares the Assignments

Parameters
aleft Assignments
bright Assignments
Returns
false the Assignments are equal
true the Assignments are not equal

Definition at line 199 of file map_assignment.h.

◆ operator!=() [2/3]

bool ddl::mapping::operator!= ( const MapSource a,
const MapSource b 
)
inline

compares MapSources in type and name

Parameters
aleft source
bright source
Returns
false they are equal in type and name
true they are not equal in type and name

Definition at line 128 of file map_source.h.

◆ operator!=() [3/3]

bool ddl::mapping::operator!= ( const MapTarget a,
const MapTarget b 
)
inline

compares the targets

Parameters
aleft target
bright target
Returns
false the targets are equal
true the targets are not equal

Definition at line 245 of file map_target.h.

◆ operator+()

Properties ddl::mapping::operator+ ( const Properties properties_left,
const Properties properties_right 
)
inline

Add operator for properties.

Parameters
properties_leftthe left properties
properties_rightthe right properties to add
Returns
Properties
Remarks
if right properties are containing a value with the same key as left it will take the right one into concern

Definition at line 340 of file mapper_interfaces.h.

◆ operator==() [1/4]

bool ddl::mapping::operator== ( const MapAssignment a,
const MapAssignment b 
)
inline

compares the Assignments

Parameters
aleft Assignments
bright Assignments
Returns
true the Assignments are equal
false the Assignments are not equal

Definition at line 184 of file map_assignment.h.

References MapAssignment::getConstant(), MapAssignment::getFrom(), MapAssignment::getFunction(), MapAssignment::getModulo(), MapAssignment::getSource(), MapAssignment::getTo(), and MapAssignment::getTransformation().

◆ operator==() [2/4]

bool ddl::mapping::operator== ( const MapSource a,
const MapSource b 
)
inline

compares MapSources in type and name

Parameters
aleft source
bright source
Returns
true they are equal in type and name
false they are not equal in type and name

Definition at line 115 of file map_source.h.

References MapSource::getName(), and MapSource::getType().

◆ operator==() [3/4]

bool ddl::mapping::operator== ( const MapTarget a,
const MapTarget b 
)

compares the targets

Parameters
aleft target
bright target
Returns
true the targets are equal
false the targets are not equal

◆ operator==() [4/4]

bool ddl::mapping::operator== ( const Property left,
const Property right 
)
inline

compare operator for Property

Parameters
leftthe left value
rightthe right value
Returns
true is equal in type and value
false is not equal in type or value

Definition at line 321 of file mapper_interfaces.h.

References Property::getType(), and Property::getValue().

◆ transformValidationProblemList()

std::vector<std::string> ddl::mapping::transformValidationProblemList ( const std::vector< Problem > &  problems)

transforms the validation protocol of problems to a simple vector of strings.


Simple usage:

//...
using namespace ddl;
mapping::MappingConfiguration my_config;
//... adding ... loading ... using
std::cout <<
a_util::strings::join(mapping::transformValidationProblemList(my_config.getValidationProtocol()),"\n");
std::string join(const std::vector< std::string > &strings, const std::string &delimiter)
Joins all strings from the vector into one string, separated by the specified delimiter string.
std::vector< std::string > transformValidationProblemList(const std::vector< Problem > &problems)
transforms the validation protocol of problems to a simple vector of strings.
Parameters
problemsthe problems to tranform.
Returns
std::vector<std::string>