Safir SDK Core
|
Container class for dictionaries of key value pairs. More...
#include <Safir/Dob/Typesystem/DictionaryContainer.h>
Public Types | |
typedef KeyT | KeyType |
typedef ValT | ValueContainerType |
typedef ValueContainerType::ContainedType | ContainedType |
typedef std::map< KeyType, ValueContainerType > | StorageType |
typedef StorageType::const_iterator | const_iterator |
typedef StorageType::iterator | iterator |
typedef StorageType::value_type | value_type |
Public Member Functions | |
DictionaryContainer () | |
Default Constructor. More... | |
virtual bool | IsNull () const |
Is the container set to null? More... | |
virtual void | SetNull () |
Set the container to null. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
iterator | find (const KeyType &key) |
const_iterator | find (const KeyType &key) const |
size_t | size () const |
bool | empty () const |
size_t | count (const KeyType &key) const |
ValueContainerType & | operator[] (const KeyType &key) |
virtual bool | IsChanged () const |
IsChanged - Check if the sequence has changed. More... | |
virtual void | SetChanged (const bool changed) |
SetChanged - Set the change state of the sequence. More... | |
void | clear () |
clear - Clear the sequence, i.e remove all values. More... | |
void | Insert (const KeyType &key, const ContainedType &val) |
size_t | erase (const KeyType &key) |
virtual void | Copy (const ContainerBase &that) |
Copy - Copy all the members from "that" into "this". More... | |
Public Member Functions inherited from Safir::Dob::Typesystem::ContainerBase | |
ContainerBase () | |
Default Constructor. More... | |
virtual | ~ContainerBase () |
Virtual destructor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Safir::Dob::Typesystem::ContainerBase | |
ContainerBase & | operator= (const ContainerBase &other) |
Copy assignment operator. More... | |
Protected Attributes inherited from Safir::Dob::Typesystem::ContainerBase | |
bool | m_bIsChanged |
The variable containing the change flag. More... | |
Container class for dictionaries of key value pairs.
A dictionary is a collection of values that can dynamically grow or shrink in size. The whole container has a change flag that will automatically be set when values are added, removed or changed.
typedef StorageType::const_iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::const_iterator |
typedef ValueContainerType::ContainedType Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::ContainedType |
typedef StorageType::iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::iterator |
typedef KeyT Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::KeyType |
typedef std::map<KeyType, ValueContainerType> Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::StorageType |
typedef StorageType::value_type Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::value_type |
typedef ValT Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::ValueContainerType |
Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::DictionaryContainer | ( | ) |
Default Constructor.
Construct a container that is not changed and not null.
iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::begin | ( | ) |
Referenced by Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Copy().
const_iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::begin | ( | ) | const |
void Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::clear | ( | ) |
clear - Clear the sequence, i.e remove all values.
After a call to clear the sequence will be empty but not automatically set to null.
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
Referenced by Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Copy().
|
virtual |
Copy - Copy all the members from "that" into "this".
Types must be the same for this to work!
that | [in] - The object to copy into this. |
SoftwareViolationException | If the types are not of the same kind. |
Implements Safir::Dob::Typesystem::ContainerBase.
References __WFILE__, Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::begin(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::clear(), Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::end(), and Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
size_t Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::count | ( | const KeyType & | key | ) | const |
Referenced by Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::erase().
bool Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::empty | ( | ) | const |
iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::end | ( | ) |
Referenced by Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Copy().
const_iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::end | ( | ) | const |
size_t Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::erase | ( | const KeyType & | key | ) |
References Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::count(), and Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::find | ( | const KeyType & | key | ) |
const_iterator Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::find | ( | const KeyType & | key | ) | const |
void Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::Insert | ( | const KeyType & | key, |
const ContainedType & | val | ||
) |
|
virtual |
IsChanged - Check if the sequence has changed.
Reimplemented from Safir::Dob::Typesystem::ContainerBase.
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
|
virtual |
Is the container set to null?
Implements Safir::Dob::Typesystem::ContainerBase.
ValueContainerType& Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::operator[] | ( | const KeyType & | key | ) |
|
virtual |
SetChanged - Set the change state of the sequence.
changed | [in] - If true, the sequence is set to changed, it is set to not changed. |
Reimplemented from Safir::Dob::Typesystem::ContainerBase.
References Safir::Dob::Typesystem::ContainerBase::m_bIsChanged.
|
virtual |
size_t Safir::Dob::Typesystem::DictionaryContainer< KeyT, ValT >::size | ( | ) | const |