DigitalSpaces::DISettingMap Struct Reference
[Containers]

#include <ContainerInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.

Inherited by DigitalSpaces::SettingMap.


Detailed Description

Used to pass a key:value map between components.

The key is a string, where value is a Variant. The reference implementation is available as DigitalSpaces::SettingMap, in ContainerImplementations.h

Todo:
Add a function for removing a value
Todo:
Add a function for setting the value of an existing key, only if it exists. This is inverse of insertValue. Until this is implemented, using getValue and using one of the Assignment Functions of DIVariant is the way to do this.
Note:
It is entirely possible for a DISettingMap to contain a DIVariant that is containing a DISettingMap. This is a feature. It is also entirely possible for a DISettingMap to contain a DIVariant, and to try and assign the containing DISettingMap to the contained DIVariant! It hasn't been tested what happens when this occurs, with the current implementation.

Public Member Functions

bool hasValue (const char *key)
 Check if the specified key has been entered into the SettingMap.
void getKeys (DIStringList1 *keys)
 Return a list of all the keys in the SettingMap.
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 Function Documentation

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

Check if the specified key has been entered into the SettingMap.

Returns:
True if the key exists, false if it doesn't.

Reimplemented in DigitalSpaces::SettingMap.

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

Return a list of all the keys in the SettingMap.

Parameters:
[out] keys A String List that will have the values of the keys appended to it. Note that the implementation does not clear the String List before adding values.

Reimplemented in DigitalSpaces::SettingMap.

DIVariant* DigitalSpaces::DISettingMap::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 in DigitalSpaces::SettingMap.

bool DigitalSpaces::DISettingMap::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 in DigitalSpaces::SettingMap.


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

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