iopc::KeyValues Class Reference
[iopclib]

As OID represents the identity of OidObject-s, KeyValues represent the identity of all other persistent non-OID objects derived from DatabaseObject. More...

#include <keyValues.h>

List of all members.

Public Types

typedef std::map< std::string,
EnhancedTypeBase * >
::const_iterator 
Iterator
 Key values iterator.

Public Member Functions

Iterator begin () const
 The iterator begin() method.
Iterator end () const
 The iterator end() method.
int size () const
 Returns number of the key values stored in the current object.
template<typename T>
void add (std::string key, ENumber< T > value)
 Adds a new ENumber<T> value.
template<typename T>
void add (std::string key, EStr< T > value)
 Adds a new EString<T> value.
template<typename T>
void add (std::string key, T value)
 Adds a new C++ built-in type or STL string type value.
void add (std::string key, EnhancedTypeBase &value)
 Adds a new Enhanced data type value.
void add (std::string key, EnhancedTypeBase *value)
 Adds a new Enhanced data type value.
void addNoCopy (std::string key, EnhancedTypeBase *value)
 Adds a new Enhanced data type value.
EnhancedTypeBaseget (const std::string &key) const
 Returns a value stored under the specified key.
bool contains (const std::string &key) const
 Determines whether the KeyValues contain any value of specified key.
void clear ()
 Clears the container.


Detailed Description

As OID represents the identity of OidObject-s, KeyValues represent the identity of all other persistent non-OID objects derived from DatabaseObject.

KeyValues contain a list of key-value pairs which represents any single-attribute or composite (multi-attribute) key.

KeyValues can be used as a key in STL containers.


Member Function Documentation

template<typename T>
void iopc::KeyValues::add ( std::string  key,
ENumber< T >  value 
) [inline]

Adds a new ENumber<T> value.

Parameters:
key Name of the key (i.e. attribute name)
value The value

template<typename T>
void iopc::KeyValues::add ( std::string  key,
EStr< T >  value 
) [inline]

Adds a new EString<T> value.

Parameters:
key Name of the key (i.e. attribute name)
value The value

template<typename T>
void iopc::KeyValues::add ( std::string  key,
value 
) [inline]

Adds a new C++ built-in type or STL string type value.

Parameters:
key Name of the key (i.e. attribute name)
value The value

void iopc::KeyValues::add ( std::string  key,
EnhancedTypeBase value 
)

Adds a new Enhanced data type value.

Parameters:
key Name of the key (i.e. attribute name)
value The value, a copy is created

void iopc::KeyValues::add ( std::string  key,
EnhancedTypeBase value 
)

Adds a new Enhanced data type value.

Parameters:
key Name of the key (i.e. attribute name)
value The value, a copy is created

void iopc::KeyValues::addNoCopy ( std::string  key,
EnhancedTypeBase value 
)

Adds a new Enhanced data type value.

Parameters:
key Name of the key (i.e. attribute name)
value A pointer to the value, no copy is created.

EnhancedTypeBase& iopc::KeyValues::get ( const std::string &  key  )  const

Returns a value stored under the specified key.

Exceptions:
IopcNotFoundException if no such key value could be found

void iopc::KeyValues::clear (  ) 

Clears the container.

Deallocates all values - copied and even those added using addNoCopy


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

Generated on Tue Apr 14 16:46:49 2009 for IOPC 2 by  doxygen 1.5.6