Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::mapping::MapConfiguration Class Reference

#include <map_configuration.h>

Public Types

enum  MapConfigFlags { mc_load_mapping = 0x1 << 0 , mc_merge_mapping = 0x1 << 1 }
 Mapping import flags (loadFromFile, loadFromDOM)
 

Public Member Functions

 MapConfiguration ()
 
 MapConfiguration (const ddl::dd::DataDefinition &ddl)
 
 ~MapConfiguration ()
 
 MapConfiguration (const MapConfiguration &other)
 
MapConfigurationoperator= (const MapConfiguration &other)
 
 MapConfiguration (MapConfiguration &&other)
 
MapConfigurationoperator= (MapConfiguration &&other)
 
a_util::result::Result setDD (const ddl::dd::DataDefinition &dd)
 
a_util::result::Result resetDD ()
 
a_util::result::Result setDDWithoutConsistency (const ddl::dd::DataDefinition &ddl)
 
a_util::result::Result modifyDD (const ddl::dd::DataDefinition &ddl)
 
std::shared_ptr< const ddl::dd::datamodel::DataDefinitiongetDD () const
 
void reset ()
 
a_util::result::Result loadFromFile (const std::string &file_path, uint32_t flags=mc_load_mapping)
 
a_util::result::Result loadFromDOM (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping)
 
a_util::result::Result loadFromDOMWithoutDDLConsistency (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping)
 
a_util::result::Result loadPartiallyFromFile (const std::string &file_path, uint32_t flags=mc_load_mapping)
 
a_util::result::Result loadPartiallyFromDOM (a_util::xml::DOM &dom, uint32_t flags=mc_load_mapping)
 
a_util::result::Result writeToFile (const std::string &file_path)
 
a_util::result::Result writeToDOM (a_util::xml::DOM &dom)
 
const MapHeadergetHeader () const
 
a_util::result::Result setHeaderDescription (const std::string &desc)
 
a_util::result::Result setHeaderDDPaths (const std::string &ddl_path)
 
const std::string & getHeaderDDPaths () const
 
const MapTransformationListgetTransformationList () const
 
const MapTransformationBasegetTransformation (const std::string &transformation_name) const
 
MapTransformationBasegetTransformation (const std::string &transformation_name)
 
a_util::result::Result addTransformation (const std::string &transformation_name, const std::string &transformation_type)
 
a_util::result::Result removeTransformation (const std::string &transformation_name)
 
const MapSourcegetSource (const std::string &source_name) const
 
MapSourcegetSource (const std::string &source_name)
 
const MapSourceListgetSourceList () const
 
a_util::result::Result addSource (const std::string &name, const std::string &type)
 
a_util::result::Result removeSource (const std::string &name)
 
const MapTargetgetTarget (const std::string &target_name) const
 
MapTargetgetTarget (const std::string &target_name)
 
a_util::result::Result addTarget (const std::string &name, const std::string &type)
 
a_util::result::Result removeTarget (const std::string &name)
 
const MapTargetListgetTargetList () const
 
const MapErrorListgetErrorList () const
 
a_util::result::Result resetErrors ()
 
void appendError (const std::string &error_string) const
 
bool isConsistencyChecked ()
 
bool isConsistent ()
 
a_util::result::Result checkDDLConsistency ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MapConfiguration() [1/4]

ddl::mapping::MapConfiguration::MapConfiguration ( )

CTOR

◆ MapConfiguration() [2/4]

ddl::mapping::MapConfiguration::MapConfiguration ( const ddl::dd::DataDefinition & ddl)

CTOR

Parameters
[in]ddlThe DataDefinition information base used for type lookup

◆ ~MapConfiguration()

ddl::mapping::MapConfiguration::~MapConfiguration ( )

DTOR

◆ MapConfiguration() [3/4]

ddl::mapping::MapConfiguration::MapConfiguration ( const MapConfiguration & other)

C-CTOR

◆ MapConfiguration() [4/4]

ddl::mapping::MapConfiguration::MapConfiguration ( MapConfiguration && other)

C-CTOR

Member Function Documentation

◆ addSource()

a_util::result::Result ddl::mapping::MapConfiguration::addSource ( const std::string & name,
const std::string & type )

Add a source signal to use in mapping

Parameters
[in]nameThe name of the source
[in]typeThe type of the source
Return values
ERR_INVALID_STATENo description found
ERR_INVALID_TYPEInconsistency with ddl
ERR_INVALID_ARGSignal name already used in configuration
a_util::result::SUCCESSEverything went fine

◆ addTarget()

a_util::result::Result ddl::mapping::MapConfiguration::addTarget ( const std::string & name,
const std::string & type )

Add a target signal to use in mapping

Parameters
[in]nameThe name of the target
[in]typeThe type of the target
Return values
ERR_INVALID_STATENo description found
ERR_INVALID_TYPEInconsistency with ddl
ERR_INVALID_ARGSignal name already used in configuration
a_util::result::SUCCESSEverything went fine

◆ addTransformation()

a_util::result::Result ddl::mapping::MapConfiguration::addTransformation ( const std::string & transformation_name,
const std::string & transformation_type )

Add a transformation to use in mapping

Parameters
[in]transformation_nameThe transformation name
[in]transformation_typeThe transformation type can be "Periodic", "Signal" or "Data"
Return values
ERR_INVALID_STATENo description found
ERR_INVALID_TYPEInconsistency with ddl
a_util::result::SUCCESSEverything went fine

◆ appendError()

void ddl::mapping::MapConfiguration::appendError ( const std::string & error_string) const

Append error to error list

◆ checkDDLConsistency()

a_util::result::Result ddl::mapping::MapConfiguration::checkDDLConsistency ( )

Checks the configuration for consistency with ddl representation (all types, transformations etc. are known and present & many other problems)

Return values
ERR_INVALID_TYPEConfiguration is inconsistent with ddl, error list is populated and validity flags are set
a_util::result::SUCCESSEverything went fine, configuration is consistent

◆ getDD()

std::shared_ptr< const ddl::dd::datamodel::DataDefinition > ddl::mapping::MapConfiguration::getDD ( ) const

Get the reference ddl description

◆ getErrorList()

const MapErrorList & ddl::mapping::MapConfiguration::getErrorList ( ) const

Returns the error list, containing human readable error messages.

Note
The error list is filled by loadFromFile and loadFromDOM and is reset on every call
Returns
Const reference to the error list

◆ getHeader()

const MapHeader & ddl::mapping::MapConfiguration::getHeader ( ) const

Returns the mapping header of the configuration

◆ getHeaderDDPaths()

const std::string & ddl::mapping::MapConfiguration::getHeaderDDPaths ( ) const

Get the ddl paths attribute from configuration header

◆ getSource() [1/2]

MapSource * ddl::mapping::MapConfiguration::getSource ( const std::string & source_name)

Returns a specific mapping source from the configuration

Parameters
[in]source_nameThe name of the source
Return values
Therequested source instance pointer
NULLif no source instance was found with that name

◆ getSource() [2/2]

const MapSource * ddl::mapping::MapConfiguration::getSource ( const std::string & source_name) const

Returns a specific mapping source from the configuration

Parameters
[in]source_nameThe name of the source
Return values
Therequested source instance pointer
NULLif no source instance was found with that name

◆ getSourceList()

const MapSourceList & ddl::mapping::MapConfiguration::getSourceList ( ) const

Returns all mapping sources contained in the configuration

◆ getTarget() [1/2]

MapTarget * ddl::mapping::MapConfiguration::getTarget ( const std::string & target_name)

Returns a specific mapping target from the configuration

Parameters
[in]target_nameThe name of the target
Return values
Therequested target instance pointer
NULLif no target instance was found with that name

◆ getTarget() [2/2]

const MapTarget * ddl::mapping::MapConfiguration::getTarget ( const std::string & target_name) const

Returns a specific mapping target from the configuration

Parameters
[in]target_nameThe name of the target
Return values
Therequested target instance pointer
NULLif no target instance was found with that name

◆ getTargetList()

const MapTargetList & ddl::mapping::MapConfiguration::getTargetList ( ) const

Returns all mapping targets contained in the configuration

◆ getTransformation() [1/2]

MapTransformationBase * ddl::mapping::MapConfiguration::getTransformation ( const std::string & transformation_name)

Returns a specific transformation from the configuration

Parameters
[in]transformation_nameThe name of the transformation
Return values
Therequested transformation base instance pointer
NULLif no transformation instance was found with that name

◆ getTransformation() [2/2]

const MapTransformationBase * ddl::mapping::MapConfiguration::getTransformation ( const std::string & transformation_name) const

Returns a specific transformation from the configuration

Parameters
[in]transformation_nameThe name of the transformation
Return values
Therequested transformation base instance pointer
NULLif no transformation instance was found with that name

◆ getTransformationList()

const MapTransformationList & ddl::mapping::MapConfiguration::getTransformationList ( ) const

Returns all transformations contained in the configuration

◆ isConsistencyChecked()

bool ddl::mapping::MapConfiguration::isConsistencyChecked ( )

Returns bool flag indicating whether consistency of mapping with its DataDefinition was already checked

Returns
Bool flag indicating whether consistency was checked

◆ isConsistent()

bool ddl::mapping::MapConfiguration::isConsistent ( )

Returns bool flag indicating consistency of mapping with its DataDefinition

Returns
Bool flag indicating consistency

◆ loadFromDOM()

a_util::result::Result ddl::mapping::MapConfiguration::loadFromDOM ( a_util::xml::DOM & dom,
uint32_t flags = mc_load_mapping )

Import mapping configuration from a XML dom instance

Parameters
[in]domThe dom instance from which to import
[in]flagsOptions for loading. See MapConfigFlags
Return values
ERR_INVALID_FLAGSInvalid flag combination
ERR_INVALID_STATENo description found
ERR_FAILEDConfiguration file is invalid (see error list for details)
ERR_INVALID_TYPEConfiguration uses unknown DataDefinition types (see error list for details)
a_util::result::SUCCESSEverything went fine

◆ loadFromDOMWithoutDDLConsistency()

a_util::result::Result ddl::mapping::MapConfiguration::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

Parameters
[in]domThe dom instance from which to import
[in]flagsOptions for loading. See MapConfigFlags
Return values
ERR_INVALID_FLAGSInvalid flag combination
ERR_FAILEDConfiguration file is invalid (see error list for details)
a_util::result::SUCCESSEverything went fine

◆ loadFromFile()

a_util::result::Result ddl::mapping::MapConfiguration::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()

Parameters
[in]file_pathThe file path to the configuration file
[in]flagsOptions for loading. See MapConfigFlags
Return values
ERR_INVALID_FILEDOM Import from file failed (see error list for details)
seeloadFromDOM()

◆ loadPartiallyFromDOM()

a_util::result::Result ddl::mapping::MapConfiguration::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

Parameters
[in]domThe dom instance from which to import
[in]flagsOptions for loading. See MapConfigFlags
Return values
ERR_INVALID_FLAGSInvalid flag combination
ERR_FAILEDConfiguration file is invalid (see error list for details)
ERR_INVALID_TYPEConfiguration uses unknown DataDefinition types (see error list for details)
a_util::result::SUCCESSEverything went fine

◆ loadPartiallyFromFile()

a_util::result::Result ddl::mapping::MapConfiguration::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

Parameters
[in]file_pathThe file path to the configuration file
[in]flagsOptions for loading. See MapConfigFlags
Return values
ERR_INVALID_FILEDOM Import from file failed (see error list for details)
seeloadPartiallyFromDOM()

◆ modifyDD()

a_util::result::Result ddl::mapping::MapConfiguration::modifyDD ( const ddl::dd::DataDefinition & ddl)

Modify the reference ddl description Set the new ddl description and check mapping consistency

Parameters
[in]ddlThe DataDefinition information base used for type lookup
Note
This call does not imply a internal Reset call
Return values
ERR_INVALID_TYPEConfiguration is inconsistent with ddl, mapping validity updated
a_util::result::SUCCESSEverything went fine

◆ operator=() [1/2]

MapConfiguration & ddl::mapping::MapConfiguration::operator= ( const MapConfiguration & other)

Assignment operator

◆ operator=() [2/2]

MapConfiguration & ddl::mapping::MapConfiguration::operator= ( MapConfiguration && other)

Assignment operator

◆ removeSource()

a_util::result::Result ddl::mapping::MapConfiguration::removeSource ( const std::string & name)

Remove a source signal from the configuration All connections using this source will be deleted

Parameters
[in]nameThe name of the target
Return values
ERR_NOT_FOUNDSource not found
a_util::result::SUCCESSEverything went fine

◆ removeTarget()

a_util::result::Result ddl::mapping::MapConfiguration::removeTarget ( const std::string & name)

Remove a target signal from the configuration All connections using this source will be deleted

Parameters
[in]nameThe name of the target
Return values
ERR_NOT_FOUNDTarget not found
a_util::result::SUCCESSEverything went fine

◆ removeTransformation()

a_util::result::Result ddl::mapping::MapConfiguration::removeTransformation ( const std::string & transformation_name)

Remove a transformation

Parameters
[in]transformation_nameThe transformation name
Return values
ERR_NOT_FOUNDTransformation not found
a_util::result::SUCCESSEverything went fine

◆ reset()

void ddl::mapping::MapConfiguration::reset ( )

Resets the entire map configuration to its initial, empty state

Note
The ddl description remains untouched by this

◆ resetDD()

a_util::result::Result ddl::mapping::MapConfiguration::resetDD ( )

Resets the reference DD

Note
This call implies an internal Reset call, the configuration is reset
Return values
a_util::result::SUCCESSEverything went fine

◆ resetErrors()

a_util::result::Result ddl::mapping::MapConfiguration::resetErrors ( )

Clear error list and verify DataDefinition Description exists

Return values
ERR_INVALID_STATENo description found
a_util::result::SUCCESSEverything went fine

◆ setDD()

a_util::result::Result ddl::mapping::MapConfiguration::setDD ( const ddl::dd::DataDefinition & dd)

Set the reference DD

Parameters
[in]ddThe DataDefinition information base used for type lookup
Note
This call implies an internal Reset call, the configuration is reset
Return values
a_util::result::SUCCESSEverything went fine

◆ setDDWithoutConsistency()

a_util::result::Result ddl::mapping::MapConfiguration::setDDWithoutConsistency ( const ddl::dd::DataDefinition & ddl)

Set the reference Data description without consistency check

Parameters
[in]ddlThe DataDefinition information base used for type lookup
Return values
a_util::result::SUCCESSEverything went fine

◆ setHeaderDDPaths()

a_util::result::Result ddl::mapping::MapConfiguration::setHeaderDDPaths ( const std::string & ddl_path)

Set the ddl paths attribute in configuration header

Return values
a_util::result::SUCCESSEverything went fine

◆ setHeaderDescription()

a_util::result::Result ddl::mapping::MapConfiguration::setHeaderDescription ( const std::string & desc)

Set the description in configuration header

Return values
a_util::result::SUCCESSEverything went fine

◆ writeToDOM()

a_util::result::Result ddl::mapping::MapConfiguration::writeToDOM ( a_util::xml::DOM & dom)

Export mapping configuration to a XML dom instance

Parameters
[in]domThe dom instance from which to import
Return values
ERR_INVALID_STATENo description found
ERR_FAILEDConfiguration is invalid (see error list for details)
ERR_INVALID_TYPEConfiguration uses unknown DataDefinition types (see error list for details)
a_util::result::SUCCESSEverything went fine

◆ writeToFile()

a_util::result::Result ddl::mapping::MapConfiguration::writeToFile ( const std::string & file_path)

Export mapping configuration to a file Call writeToDOM() and wirte DOM to file

Parameters
[in]file_pathThe file path to the configuration file
Return values
ERR_INVALID_FILECan not write in file (see error list for details)
seewriteToDOM()

The documentation for this class was generated from the following file: