Actin®  Version 5.2.0
Software for Robotics Simulation and Control
EcXmlMapType< KeyType, ValueType > Class Template Reference

An XML readable/writable Map. More...

#include <ecXmlMapType.h>

Inheritance diagram for EcXmlMapType< KeyType, ValueType >:
EcXmlObject EcManipulatorSelfCollisionLinkMap EcOldManipulatorAttachmentMap EcPathPlannerHelperManager

Public Types

typedef std::map< KeyType, ValueType > MapContainer
 type definition of the MapContainer based on std::map
 
typedef EcXmlMapType< KeyType, ValueType > class_type
 type definition of the EcXmlMapType
 

Public Member Functions

 ECXMLOBJECT (EcXmlMapType)
 ECXMLOBJECT(cls) EcXmlObject class convenience macro
 
 EcXmlMapType (KeyType key, ValueType value)
 single value constructor
 
virtual EcBoolean lookup (const KeyType &key, ValueType &value) const
 lookup a value from a key. Returns false if the key is not in the map.
 
virtual const ValueType * lookupPointer (const KeyType &key) const
 
virtual ValueType * lookupPointer (const KeyType &key)
 
virtual void add (const KeyType &key, const ValueType &value)
 add a key/value pair
 
virtual EcBoolean erase (const KeyType &key)
 
virtual void clear ()
 erase all key/value pairs, leaving an empty map
 
virtual const MapContainermapContainer () const
 get the map container
 
virtual MapContainermapContainer ()
 get the map container – nonconst
 
virtual EcBoolean keyIndex (const KeyType &key, EcSizeT &index) const
 
virtual EcBoolean indexKey (const EcSizeT &index, KeyType &key) const
 
virtual EcSizeT size () const
 get the size of the map container
 
virtual EcBoolean read (EcXmlReader &stream) EC_OVERRIDE
 read this object from an XML stream
 
virtual EcBoolean write (EcXmlWriter &stream) const EC_OVERRIDE
 write this object to an XML stream
 
virtual EcBoolean writeSchema (EcXmlSchema &stream) const EC_OVERRIDE
 write this object to an XML schema
 
- Public Member Functions inherited from EcXmlObject
 ECDECLARE_BIGFOUR (EcXmlObject)
 
virtual EcXmlObjectclone () const =0
 clone
 
virtual EcBoolean xmlInit ()
 xml-initialize
 
virtual EcBoolean readAttribute (EcXmlReader &stream)
 read this attribute from an XML stream
 
virtual EcBoolean createSchema (const EcString &filename, const EcToken &objectName=EcXml::EcDefaultToken) const
 create schema
 
virtual EcBoolean xmlInitialized () const
 get XML initialized flag. This bit is set on initialization.
 
virtual void setXmlInitialized (EcBoolean val=EcTrue)
 set XML initialized flag. This bit is set on initialization.
 
virtual EcBoolean specified () const
 get specified flag. This bit is set upon reading from an XML file.
 
virtual void setSpecified (EcBoolean val=EcTrue)
 set specified flag. This bit is set upon reading from an XML file.
 
virtual EcBoolean isBasicType () const
 Return true/false for basic type.
 
virtual EcBoolean equalsDefault () const
 tests equality of XML object with default
 
virtual EcBoolean equality (const EcXmlObject *other) const =0
 equality - a virtual equality to an EcXmlObject pointer
 
virtual EcXmlObjectnewObject () const =0
 creates new object - a virtual new to an EcXmlObject pointer
 
virtual const EcTokentoken () const =0
 gets the xml token used for writing out.
 

Static Public Member Functions

static MapContainer nullObject ()
 get a null value
 

Protected Attributes

MapContainer m_MapContainer
 the internal representation of the map.
 
- Protected Attributes inherited from EcXmlObject
EcU8 m_State
 the state of the object - eight boolean flags
 

Additional Inherited Members

- Static Protected Attributes inherited from EcXmlObject
static const EcU8 m_theXmlInitializedBit
 the bit used to describe xml initialization
 
static const EcU8 m_theSpecifiedBit
 the bit used to describe specification
 

Detailed Description

template<class KeyType, class ValueType>
class EcXmlMapType< KeyType, ValueType >

An XML readable/writable Map.

Template Parameters
KeyTypethe map key type
ValueTypethe map value type

Can map strings to strings, strings to 32-bit Integers, an strings to Reals. Potentially can easily map any XML Object type to any other XML Object, but this will require implementing < for the key type and adding specialization code to this class.

Definition at line 23 of file ecXmlMapType.h.

Member Function Documentation

template<class KeyType, class ValueType>
virtual EcBoolean EcXmlMapType< KeyType, ValueType >::erase ( const KeyType &  key)
virtual

erase a key/value pair, if the key exists in the map returns true if the key existed.

template<class KeyType, class ValueType>
virtual EcBoolean EcXmlMapType< KeyType, ValueType >::indexKey ( const EcSizeT index,
KeyType &  key 
) const
virtual

get the key at an index location (the order in the map). Returns false if the index doesn't exist in the map.

template<class KeyType, class ValueType>
virtual EcBoolean EcXmlMapType< KeyType, ValueType >::keyIndex ( const KeyType &  key,
EcSizeT index 
) const
virtual

get the index (the order in the map) of a key. Returns false if the key doesn't exist in the map.

template<class KeyType, class ValueType>
virtual const ValueType* EcXmlMapType< KeyType, ValueType >::lookupPointer ( const KeyType &  key) const
virtual

lookup a value pointer from a key. Returns NULL if the key is not in the map. Use with care.

template<class KeyType, class ValueType>
virtual ValueType* EcXmlMapType< KeyType, ValueType >::lookupPointer ( const KeyType &  key)
virtual

lookup a value pointer from a key. Returns NULL if the key is not in the map. Non-const version. Also use with care.


The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.