ADTF  3.18.2
MapTarget

MapTarget represents a mapped target from the mapping configuration. More...

Public Member Functions

 MapTarget (MapConfiguration *config)
 CTOR.
 
 MapTarget (MapConfiguration *config, std::string name, std::string type)
 CTOR. More...
 
 ~MapTarget ()
 DTOR.
 
 MapTarget (const MapTarget &other)
 CCTOR.
 
MapTargetoperator= (const MapTarget &other)
 Assignment operator. More...
 
const std::string & getName () const
 Returns the name of the mapped target. More...
 
a_util::result::Result setName (const std::string &name)
 Set name. More...
 
const std::string & getType () const
 Returns the DataDefinition typename of the mapped target. More...
 
a_util::result::Result setType (const std::string &type)
 Set type. More...
 
bool isValid () const
 Returns the validity for the current description. More...
 
a_util::result::Result addAssignment (const MapAssignment &assignment)
 Add an assignment. More...
 
a_util::result::Result removeAssignment (const std::string &element_name)
 Remove an assignment. More...
 
const MapAssignmentListgetAssignmentList () const
 Returns all assignments configured for this target.
 
a_util::result::Result addTrigger (MapTriggerBase *trigger)
 Add a trigger. More...
 
a_util::result::Result removeTrigger (MapTriggerBase *trigger)
 Remove a trigger. More...
 
const MapTriggerListgetTriggerList () const
 Returns all triggers configured for this target.
 
const MapSourceNameListgetReferencedSources () const
 Returns all referenced sources for this target.
 

Private Member Functions

a_util::result::Result loadFromDOM (const a_util::xml::DOMElement &target)
 Initializes the target from a target-dom element. More...
 
a_util::result::Result writeToDOM (a_util::xml::DOMElement &dom_element) const
 Export target to a XML dom element. More...
 
a_util::result::Result checkDoubleAssignments ()
 Checks if the assignments overlap. More...
 
a_util::result::Result addAssignmentNoTypeCheck (const MapAssignment &assignment)
 Add an assignment to this target. More...
 
a_util::result::Result removeAssignmentWithoutClear (const std::string &element_name)
 Remove an assignment from this target. More...
 
a_util::result::Result addTriggerNoTypeCheck (MapTriggerBase *trigger)
 Add a trigger to this target. More...
 
a_util::result::Result modifySourceName (const std::string &name, const std::string &new_name)
 Modify a source signal name. More...
 
void swap (MapTarget &other)
 swap implementation
 

Detailed Description

MapTarget represents a mapped target from the mapping configuration.

Definition at line 31 of file map_target.h.

Constructor & Destructor Documentation

◆ MapTarget()

MapTarget ( MapConfiguration config,
std::string  name,
std::string  type 
)

CTOR.

Parameters
[in]configconfig this target belong to
[in]nameThe signal name
[in]typeThe signal type

Member Function Documentation

◆ addAssignment()

a_util::result::Result addAssignment ( const MapAssignment assignment)

Add an assignment.

Parameters
[in]assignmentThe assignment to add
Return values
ERR_INVALID_STATENo description found
ERR_INVALID_ARGInconsistency with current configuration
ERR_INVALID_TYPEInconsistency with ddl
ERR_NOT_SUPPORTEDAssignment overlap with existing assignments
a_util::result::SUCCESSEverything went fine

◆ addAssignmentNoTypeCheck()

a_util::result::Result addAssignmentNoTypeCheck ( const MapAssignment assignment)
private

Add an assignment to this target.

Parameters
[in]assignmentThe assignment to add
Return values
ERR_INVALID_ARGMissing or erroneous attribute
a_util::result::SUCCESSEverything went fine

◆ addTrigger()

a_util::result::Result addTrigger ( MapTriggerBase trigger)

Add a trigger.

Parameters
[in]triggerThe trigger to add
Return values
ERR_INVALID_STATENo description found
ERR_NOT_FOUNDTarget not found
ERR_INVALID_ARGInconsistency with current configuration
ERR_INVALID_TYPEInconsistency with ddl
a_util::result::SUCCESSEverything went fine

◆ addTriggerNoTypeCheck()

a_util::result::Result addTriggerNoTypeCheck ( MapTriggerBase trigger)
private

Add a trigger to this target.

Parameters
[in]triggerThe trigger to add
Return values
a_util::result::SUCCESSEverything went fine

◆ checkDoubleAssignments()

a_util::result::Result checkDoubleAssignments ( )
private

Checks if the assignments overlap.

Return values
ERR_NOT_SUPPORTEDAssignments overlap
a_util::result::SUCCESSEverything went fine

◆ getName()

const std::string& getName ( ) const

Returns the name of the mapped target.

Returns
the name

◆ getType()

const std::string& getType ( ) const

Returns the DataDefinition typename of the mapped target.

Returns
the type

◆ isValid()

bool isValid ( ) const

Returns the validity for the current description.

Returns
the valid state

◆ loadFromDOM()

a_util::result::Result loadFromDOM ( const a_util::xml::DOMElement target)
private

Initializes the target from a target-dom element.

Parameters
[in]targetThe dom element from which to import
Return values
ERR_INVALID_ARGMissing name or type
a_util::result::SUCCESSEverything went fine

◆ modifySourceName()

a_util::result::Result modifySourceName ( const std::string &  name,
const std::string &  new_name 
)
private

Modify a source signal name.

Parameters
[in]nameThe name of the target
[in]new_nameThe new name of the target
Return values
a_util::result::SUCCESSEverything went fine

◆ operator=()

MapTarget& operator= ( const MapTarget other)

Assignment operator.

Parameters
otherthe other
Returns
MapTarget&

◆ removeAssignment()

a_util::result::Result removeAssignment ( const std::string &  element_name)

Remove an assignment.

Parameters
[in]element_nameThe name of the assigned element
Return values
ERR_NOT_FOUNDAssignement not found
a_util::result::SUCCESSEverything went fine

◆ removeAssignmentWithoutClear()

a_util::result::Result removeAssignmentWithoutClear ( const std::string &  element_name)
private

Remove an assignment from this target.

Parameters
[in]element_nameThe name of the target element to unassign
Return values
ERR_NOT_FOUNDAssignement not found
a_util::result::SUCCESSEverything went fine

◆ removeTrigger()

a_util::result::Result removeTrigger ( MapTriggerBase trigger)

Remove a trigger.

Parameters
[in]triggerThe trigger to remove
Return values
ERR_NOT_FOUNDTrigger not found
a_util::result::SUCCESSEverything went fine

◆ setName()

a_util::result::Result setName ( const std::string &  name)

Set name.

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

◆ setType()

a_util::result::Result setType ( const std::string &  type)

Set type.

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

◆ writeToDOM()

a_util::result::Result writeToDOM ( a_util::xml::DOMElement dom_element) const
private

Export target to a XML dom element.

Parameters
[in]dom_elementThe dom element to be written
Return values
a_util::result::SUCCESSEverything went fine