ADTF
3.18.2
|
MapConfiguration is the central class of the mapping::dd namespace. More...
Public Types | |
enum | MapConfigFlags { mc_load_mapping = 0x1 << 0 , mc_merge_mapping = 0x1 << 1 } |
Mapping import flags (loadFromFile, loadFromDOM) | |
Public Member Functions | |
MapConfiguration () | |
CTOR. | |
MapConfiguration (const ddl::dd::DataDefinition &ddl) | |
CTOR. More... | |
~MapConfiguration () | |
DTOR. | |
MapConfiguration (const MapConfiguration &other) | |
C-CTOR. | |
MapConfiguration & | operator= (const MapConfiguration &other) |
Assignment operator. | |
MapConfiguration (MapConfiguration &&other) | |
C-CTOR. | |
MapConfiguration & | operator= (MapConfiguration &&other) |
Assignment operator. | |
a_util::result::Result | setDD (const ddl::dd::DataDefinition &dd) |
Set the reference DD. More... | |
a_util::result::Result | resetDD () |
Resets the reference DD. More... | |
a_util::result::Result | setDDWithoutConsistency (const ddl::dd::DataDefinition &ddl) |
Set the reference Data description without consistency check. More... | |
a_util::result::Result | modifyDD (const ddl::dd::DataDefinition &ddl) |
Modify the reference ddl description Set the new ddl description and check mapping consistency. More... | |
std::shared_ptr< const ddl::dd::datamodel::DataDefinition > | getDD () const |
Get the reference ddl description. | |
void | reset () |
Resets the entire map configuration to its initial, empty state. More... | |
a_util::result::Result | loadFromFile (const std::string &file_path, uint32_t flags=mc_load_mapping) |
Import mapping configuration from a file Load file in DOM and call loadFromDOM() More... | |
a_util::result::Result | loadFromDOM (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping) |
Import mapping configuration from a XML dom instance. More... | |
a_util::result::Result | loadFromDOMWithoutDDLConsistency (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping) |
Import mapping configuration from a XML dom instance without checking for DataDefinition consistency. More... | |
a_util::result::Result | loadPartiallyFromFile (const std::string &file_path, uint32_t flags=mc_load_mapping) |
Import mapping configuration from a file Load file in DOM and call loadPartiallyFromDOM() Modell is loaded even if it is not consistent with the DataDefinition description Each element has a validity flag representing its consistency. More... | |
a_util::result::Result | loadPartiallyFromDOM (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping) |
Import mapping configuration from a XML dom instance Modell is laoding even if it is not consistent with the DataDefinition description Each element has a validity flag representing its consistency. More... | |
a_util::result::Result | writeToFile (const std::string &file_path) |
Export mapping configuration to a file Call writeToDOM() and wirte DOM to file. More... | |
a_util::result::Result | writeToDOM (a_util::xml::DOM &dom) |
Export mapping configuration to a XML dom instance. More... | |
const MapHeader & | getHeader () const |
Returns the mapping header of the configuration. | |
a_util::result::Result | setHeaderDescription (const std::string &desc) |
Set the description in configuration header. More... | |
a_util::result::Result | setHeaderDDPaths (const std::string &ddl_path) |
Set the ddl paths attribute in configuration header. More... | |
const std::string & | getHeaderDDPaths () const |
Get the ddl paths attribute from configuration header. | |
const MapTransformationList & | getTransformationList () const |
Returns all transformations contained in the configuration. | |
const MapTransformationBase * | getTransformation (const std::string &transformation_name) const |
Returns a specific transformation from the configuration. More... | |
MapTransformationBase * | getTransformation (const std::string &transformation_name) |
Returns a specific transformation from the configuration. More... | |
a_util::result::Result | addTransformation (const std::string &transformation_name, const std::string &transformation_type) |
Add a transformation to use in mapping. More... | |
a_util::result::Result | removeTransformation (const std::string &transformation_name) |
Remove a transformation. More... | |
const MapSource * | getSource (const std::string &source_name) const |
Returns a specific mapping source from the configuration. More... | |
MapSource * | getSource (const std::string &source_name) |
Returns a specific mapping source from the configuration. More... | |
const MapSourceList & | getSourceList () const |
Returns all mapping sources contained in the configuration. | |
a_util::result::Result | addSource (const std::string &name, const std::string &type) |
Add a source signal to use in mapping. More... | |
a_util::result::Result | removeSource (const std::string &name) |
Remove a source signal from the configuration All connections using this source will be deleted. More... | |
const MapTarget * | getTarget (const std::string &target_name) const |
Returns a specific mapping target from the configuration. More... | |
MapTarget * | getTarget (const std::string &target_name) |
Returns a specific mapping target from the configuration. More... | |
a_util::result::Result | addTarget (const std::string &name, const std::string &type) |
Add a target signal to use in mapping. More... | |
a_util::result::Result | removeTarget (const std::string &name) |
Remove a target signal from the configuration All connections using this source will be deleted. More... | |
const MapTargetList & | getTargetList () const |
Returns all mapping targets contained in the configuration. | |
const MapErrorList & | getErrorList () const |
Returns the error list, containing human readable error messages. More... | |
a_util::result::Result | resetErrors () |
Clear error list and verify DataDefinition Description exists. More... | |
void | appendError (const std::string &error_string) const |
Append error to error list. | |
bool | isConsistencyChecked () |
Returns bool flag indicating whether consistency of mapping with its DataDefinition was already checked. More... | |
bool | isConsistent () |
Returns bool flag indicating consistency of mapping with its DataDefinition. More... | |
a_util::result::Result | checkDDLConsistency () |
Checks the configuration for consistency with ddl representation (all types, transformations etc. More... | |
Private Member Functions | |
MapConfiguration (const std::shared_ptr< const ddl::dd::datamodel::DataDefinition > &ddl_datamodel) | |
CTOR. More... | |
void | swap (MapConfiguration &other) |
swap implementation for use in the assignment op | |
void | repairConfigReferences (MapConfiguration &config) |
Set reference to new configuration. More... | |
a_util::result::Result | addTarget (const MapTarget &target) |
Add a target signal to configuration. More... | |
a_util::result::Result | addSource (const MapSource &source) |
Add a source signal to configuration. More... | |
a_util::result::Result | checkMappingConsistency () |
Checks the mapping for consistency All referenced Sources and Transformations must exist in Mapping. More... | |
a_util::result::Result | merge (const MapConfiguration &other) |
merge another configuration into this one More... | |
const ddl::dd::StructElementAccess | findTypeObject (const std::string &struct_name, const std::string &path) const |
Find a DataDefinition data type within a struct given a path to the element. More... | |
a_util::result::Result | checkSignalName (const std::string &name) const |
Checks the configuration for consistency of a new signal. More... | |
a_util::result::Result | checkSignalType (const std::string &type) const |
Checks the configuration for consistency of a new signal. More... | |
a_util::result::Result | checkAssignmentReferences (const MapAssignment &assignment) const |
Checks the configuration for consistency of a new assignment. More... | |
a_util::result::Result | checkAssignmentType (const std::string &signal_name, const ddl::dd::datamodel::StructType &signal_struct, const MapAssignment &assignment) const |
Checks the configuration for consistency of a new assignment. More... | |
a_util::result::Result | checkTriggerType (const MapTriggerBase *trigger) const |
Checks the configuration for consistency of a new trigger. More... | |
Static Private Member Functions | |
static a_util::result::Result | loadMappingFromDOM (a_util::xml::DOM &dom, MapConfiguration &tmp_config) |
Import mapping configuration from a XML dom instance. More... | |
MapConfiguration is the central class of the mapping::dd namespace.
It represents a whole mapping configuration which can be imported from a mapping configuration file.
Definition at line 36 of file map_configuration.h.
MapConfiguration | ( | const ddl::dd::DataDefinition & | ddl | ) |
CTOR.
[in] | ddl | The DataDefinition information base used for type lookup |
|
private |
CTOR.
[in] | ddl_datamodel | The DataDefinition information base used for type lookup |
|
private |
Add a source signal to configuration.
[in] | source | The source signal |
ERR_INVALID_ARG | Signal name already used in configuration |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result addSource | ( | const std::string & | name, |
const std::string & | type | ||
) |
Add a source signal to use in mapping.
[in] | name | The name of the source |
[in] | type | The type of the source |
ERR_INVALID_STATE | No description found |
ERR_INVALID_TYPE | Inconsistency with ddl |
ERR_INVALID_ARG | Signal name already used in configuration |
a_util::result::SUCCESS | Everything went fine |
|
private |
Add a target signal to configuration.
[in] | target | The target signal |
ERR_INVALID_ARG | Signal name already used in configuration |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result addTarget | ( | const std::string & | name, |
const std::string & | type | ||
) |
Add a target signal to use in mapping.
[in] | name | The name of the target |
[in] | type | The type of the target |
ERR_INVALID_STATE | No description found |
ERR_INVALID_TYPE | Inconsistency with ddl |
ERR_INVALID_ARG | Signal name already used in configuration |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result addTransformation | ( | const std::string & | transformation_name, |
const std::string & | transformation_type | ||
) |
Add a transformation to use in mapping.
[in] | transformation_name | The transformation name |
[in] | transformation_type | The transformation type can be "Periodic", "Signal" or "Data" |
ERR_INVALID_STATE | No description found |
ERR_INVALID_TYPE | Inconsistency with ddl |
a_util::result::SUCCESS | Everything went fine |
|
private |
Checks the configuration for consistency of a new assignment.
[in] | assignment | The assignment to check |
ERR_INVALID_ARG | Reference not found in Configuration |
a_util::result::SUCCESS | Everything went fine |
|
private |
Checks the configuration for consistency of a new assignment.
[in] | signal_name | The name of the target signal (for error list) |
[in] | signal_struct | The ddl structure for the signal |
[in] | assignment | The assignment to check |
ERR_INVALID_TYPE | Definition is inconsistent with ddl |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result checkDDLConsistency | ( | ) |
Checks the configuration for consistency with ddl representation (all types, transformations etc.
are known and present & many other problems)
ERR_INVALID_TYPE | Configuration is inconsistent with ddl, error list is populated and validity flags are set |
a_util::result::SUCCESS | Everything went fine, configuration is consistent |
|
private |
Checks the mapping for consistency All referenced Sources and Transformations must exist in Mapping.
ERR_INVALID_ARG | Unknown source or transformation is used |
a_util::result::SUCCESS | Everything went fine, configuration is consistent |
|
private |
Checks the configuration for consistency of a new signal.
[in] | name | The signal name |
ERR_INVALID_ARG | Signal name already used in configuration |
a_util::result::SUCCESS | Everything went fine |
|
private |
Checks the configuration for consistency of a new signal.
[in] | type | The type of the signal |
ERR_INVALID_TYPE | Type not found in DataDefinition |
a_util::result::SUCCESS | Everything went fine |
|
private |
Checks the configuration for consistency of a new trigger.
[in] | trigger | The trigger to check |
ERR_INVALID_TYPE | Definition is inconsistent with ddl |
a_util::result::SUCCESS | Everything went fine |
|
private |
Find a DataDefinition data type within a struct given a path to the element.
[in] | struct_name | Name of the struct type |
[in] | path | Path to be found |
const MapErrorList& getErrorList | ( | ) | const |
Returns the error list, containing human readable error messages.
MapSource* getSource | ( | const std::string & | source_name | ) |
Returns a specific mapping source from the configuration.
[in] | source_name | The name of the source |
The | requested source instance pointer |
NULL | if no source instance was found with that name |
const MapSource* getSource | ( | const std::string & | source_name | ) | const |
Returns a specific mapping source from the configuration.
[in] | source_name | The name of the source |
The | requested source instance pointer |
NULL | if no source instance was found with that name |
MapTarget* getTarget | ( | const std::string & | target_name | ) |
Returns a specific mapping target from the configuration.
[in] | target_name | The name of the target |
The | requested target instance pointer |
NULL | if no target instance was found with that name |
const MapTarget* getTarget | ( | const std::string & | target_name | ) | const |
Returns a specific mapping target from the configuration.
[in] | target_name | The name of the target |
The | requested target instance pointer |
NULL | if no target instance was found with that name |
MapTransformationBase* getTransformation | ( | const std::string & | transformation_name | ) |
Returns a specific transformation from the configuration.
[in] | transformation_name | The name of the transformation |
The | requested transformation base instance pointer |
NULL | if no transformation instance was found with that name |
const MapTransformationBase* getTransformation | ( | const std::string & | transformation_name | ) | const |
Returns a specific transformation from the configuration.
[in] | transformation_name | The name of the transformation |
The | requested transformation base instance pointer |
NULL | if no transformation instance was found with that name |
bool isConsistencyChecked | ( | ) |
Returns bool flag indicating whether consistency of mapping with its DataDefinition was already checked.
bool isConsistent | ( | ) |
Returns bool flag indicating consistency of mapping with its DataDefinition.
a_util::result::Result loadFromDOM | ( | a_util::xml::DOM & | dom, |
uint32_t | flags = mc_load_mapping |
||
) |
Import mapping configuration from a XML dom instance.
[in] | dom | The dom instance from which to import |
[in] | flags | Options for loading. See MapConfigFlags |
ERR_INVALID_FLAGS | Invalid flag combination |
ERR_INVALID_STATE | No description found |
ERR_FAILED | Configuration file is invalid (see error list for details) |
ERR_INVALID_TYPE | Configuration uses unknown DataDefinition types (see error list for details) |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result loadFromDOMWithoutDDLConsistency | ( | a_util::xml::DOM & | dom, |
uint32_t | flags = mc_load_mapping |
||
) |
Import mapping configuration from a XML dom instance without checking for DataDefinition consistency.
[in] | dom | The dom instance from which to import |
[in] | flags | Options for loading. See MapConfigFlags |
ERR_INVALID_FLAGS | Invalid flag combination |
ERR_FAILED | Configuration file is invalid (see error list for details) |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result loadFromFile | ( | const std::string & | file_path, |
uint32_t | flags = mc_load_mapping |
||
) |
Import mapping configuration from a file Load file in DOM and call loadFromDOM()
[in] | file_path | The file path to the configuration file |
[in] | flags | Options for loading. See MapConfigFlags |
ERR_INVALID_FILE | DOM Import from file failed (see error list for details) |
see | loadFromDOM() |
|
staticprivate |
Import mapping configuration from a XML dom instance.
[in] | dom | The dom instance from which to import |
[out] | tmp_config | The temporary configuration to create |
ERR_INVALID_ARG | DOM does not contains a valid mapping |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result loadPartiallyFromDOM | ( | a_util::xml::DOM & | dom, |
uint32_t | flags = mc_load_mapping |
||
) |
Import mapping configuration from a XML dom instance Modell is laoding even if it is not consistent with the DataDefinition description Each element has a validity flag representing its consistency.
[in] | dom | The dom instance from which to import |
[in] | flags | Options for loading. See MapConfigFlags |
ERR_INVALID_FLAGS | Invalid flag combination |
ERR_FAILED | Configuration file is invalid (see error list for details) |
ERR_INVALID_TYPE | Configuration uses unknown DataDefinition types (see error list for details) |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result loadPartiallyFromFile | ( | const std::string & | file_path, |
uint32_t | flags = mc_load_mapping |
||
) |
Import mapping configuration from a file Load file in DOM and call loadPartiallyFromDOM() Modell is loaded even if it is not consistent with the DataDefinition description Each element has a validity flag representing its consistency.
[in] | file_path | The file path to the configuration file |
[in] | flags | Options for loading. See MapConfigFlags |
ERR_INVALID_FILE | DOM Import from file failed (see error list for details) |
see | loadPartiallyFromDOM() |
|
private |
merge another configuration into this one
[in] | other | The other instance to be merged |
ERR_INVALID_ARG | Type conflict |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result modifyDD | ( | const ddl::dd::DataDefinition & | ddl | ) |
Modify the reference ddl description Set the new ddl description and check mapping consistency.
[in] | ddl | The DataDefinition information base used for type lookup |
ERR_INVALID_TYPE | Configuration is inconsistent with ddl, mapping validity updated |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result removeSource | ( | const std::string & | name | ) |
Remove a source signal from the configuration All connections using this source will be deleted.
[in] | name | The name of the target |
ERR_NOT_FOUND | Source not found |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result removeTarget | ( | const std::string & | name | ) |
Remove a target signal from the configuration All connections using this source will be deleted.
[in] | name | The name of the target |
ERR_NOT_FOUND | Target not found |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result removeTransformation | ( | const std::string & | transformation_name | ) |
Remove a transformation.
[in] | transformation_name | The transformation name |
ERR_NOT_FOUND | Transformation not found |
a_util::result::SUCCESS | Everything went fine |
|
private |
Set reference to new configuration.
[in] | config | The configuration to reference |
void reset | ( | ) |
Resets the entire map configuration to its initial, empty state.
a_util::result::Result resetDD | ( | ) |
Resets the reference DD.
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result resetErrors | ( | ) |
Clear error list and verify DataDefinition Description exists.
ERR_INVALID_STATE | No description found |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setDD | ( | const ddl::dd::DataDefinition & | dd | ) |
Set the reference DD.
[in] | dd | The DataDefinition information base used for type lookup |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setDDWithoutConsistency | ( | const ddl::dd::DataDefinition & | ddl | ) |
Set the reference Data description without consistency check.
[in] | ddl | The DataDefinition information base used for type lookup |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setHeaderDDPaths | ( | const std::string & | ddl_path | ) |
Set the ddl paths attribute in configuration header.
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result setHeaderDescription | ( | const std::string & | desc | ) |
Set the description in configuration header.
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result writeToDOM | ( | a_util::xml::DOM & | dom | ) |
Export mapping configuration to a XML dom instance.
[in] | dom | The dom instance from which to import |
ERR_INVALID_STATE | No description found |
ERR_FAILED | Configuration is invalid (see error list for details) |
ERR_INVALID_TYPE | Configuration uses unknown DataDefinition types (see error list for details) |
a_util::result::SUCCESS | Everything went fine |
a_util::result::Result writeToFile | ( | const std::string & | file_path | ) |
Export mapping configuration to a file Call writeToDOM() and wirte DOM to file.
[in] | file_path | The file path to the configuration file |
ERR_INVALID_FILE | Can not write in file (see error list for details) |
see | writeToDOM() |