DigitalSpaces::SettingMap Class Reference
[Implementations]

#include <ContainerImplementations.h>

Inherits std::map< std::string, DigitalSpaces::Variant >, and DigitalSpaces::DISettingMap.


Detailed Description

Implements a flexible key-to-value map collection, using strings for keys and Variant for values.

Public Types

typedef std::map< std::string,
Variant
base_type
 For convenience.

Public Member Functions

 SettingMap (const SettingMap &rhs)
 Copy constructor.
 SettingMap ()
 Default constructor, creates an empty map (with no key-value entries).
 SettingMap (DISettingMap *rhs)
 Constructor that copies the value from a DISettingMap.
Interface Functions
These functions are those required by DISettingMap

bool hasValue (const char *key)
 Test for the existance of a key.
void getKeys (DIStringList1 *keys)
 Append the available keys to the provided String List.
DIVariantgetValue (const char *key)
 Extracts a value from the SettingMap.
bool insertValue (const char *key, DIVariant *value)
 Insert a new value into the SettingMap.

Member Typedef Documentation

typedef std::map<std::string, Variant> DigitalSpaces::SettingMap::base_type

For convenience.


Constructor & Destructor Documentation

DigitalSpaces::SettingMap::SettingMap ( const SettingMap rhs  )  [inline]

Copy constructor.

DigitalSpaces::SettingMap::SettingMap (  )  [inline]

Default constructor, creates an empty map (with no key-value entries).

DigitalSpaces::SettingMap::SettingMap ( DISettingMap rhs  )  [inline]

Constructor that copies the value from a DISettingMap.

Todo:
Needs to be able to construct from a DISettingMap without doing a dubious cast.
Note:
If this starts showing signs of using invalid memory, try a deep copy instead of a constructor based copy.


Member Function Documentation

bool DigitalSpaces::SettingMap::hasValue ( const char *  key  ) 

Test for the existance of a key.

Returns:
True if present, false otherwise.

Reimplemented from DigitalSpaces::DISettingMap.

void DigitalSpaces::SettingMap::getKeys ( DIStringList1 keys  ) 

Append the available keys to the provided String List.

Parameters:
keys String List that will have the avialable keys appended to it. The implementation will not clear the list before appending the key names.

Reimplemented from DigitalSpaces::DISettingMap.

DIVariant* DigitalSpaces::SettingMap::getValue ( const char *  key  ) 

Extracts a value from the SettingMap.

If there is no entry of this value, it will return a new entry by that name. Note that this returned DIVariant is the data being stored inside the DISettingMap, not a copy. Thus, changing the data stored in the DIVariant will change the data in the map.

Reimplemented from DigitalSpaces::DISettingMap.

bool DigitalSpaces::SettingMap::insertValue ( const char *  key,
DIVariant value 
)

Insert a new value into the SettingMap.

Returns true if sucessful. If an entry with this key already exists, it will not be altered. Note that the inserted value is copied, ie, changing the value variant will not change the data in the map.

Reimplemented from DigitalSpaces::DISettingMap.


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

Generated on Sun Aug 31 17:46:32 2008 for Digital Spaces by  doxygen 1.5.6