Class for storing objects of a given type with an identifier. More...
#include <ilserver/model.h>
Inherits IlsEntityContext.
Classes | |
class | Iterator |
IlsDictionary iterator. More... | |
Public Types | |
typedef IlsDictionary< ValueType > | Myself |
Myself is the type of the instantiated template class. | |
Public Member Functions | |
Myself & | clear () |
ValueTypeP | get (IlsCIdentifierR identifier) const |
unsigned int | getCount () const |
Returns the number of objects contained in the dictionary. | |
IlsBoolean | isIn (IlsCIdentifierR identifier) |
Myself & | operator<< (CValueTypePR v) |
Myself & | operator>> (CValueTypePR) |
This extraction operator removes the smart pointer to an object of type ValueType from the dictionary. More... | |
ValueTypeP | operator[] (IlsCIdentifierR identifier) const |
This operator is identical to the function IlsDictionary::get described above. | |
Myself & | suppress (IlsCIdentifierR, IlsBoolean notify_destruction=IlsTrue) |
Class for storing objects of a given type with an identifier.
ValueType | Class of objects stored into the dictionary. |
Library: server
Rogue Wave Server lets you store objects of a given type in a dictionary and manipulate these objects by means of their identifier.
A dictionary is an instance of the class template IlsDictionary
. You can declare a dictionary for each class that derives directly or transitively from IlsEntity
or IlsObject
. However, if you declare a dictionary for a class that derives from IlsObject
, you must add the getIdentifier
member function to the class declaration. The signature of this function must be:
The class IlsEntity
contains this member function by default.
IlsException
, IlsDictionary::Iterator
, IlsEntity
, IlsObject
. Myself& IlsDictionary< ValueType >::clear | ( | ) |
\short Empties the dictionary.
IlsClearingOpenTable | If an iterator points to the dictionary when this function is called. |
ValueTypeP IlsDictionary< ValueType >::get | ( | IlsCIdentifierR | identifier | ) | const |
\short Returns a smart pointer to the object matching
the identifier passed as its argument.
If no object is associated with the specified identifier, a null smart pointer is returned.
IlsNullPointerEncountered | If the identifier passed to this function is a null smart pointer. |
IlsBoolean IlsDictionary< ValueType >::isIn | ( | IlsCIdentifierR | identifier | ) |
\short Returns \c IlsTrue if the dictionary contains the
object that corresponds to the specified identifier. Otherwise, it returns IlsFalse
.
IlsNullPointerEncountered | If the identifier passed to this function is a null smart pointer. |
Myself& IlsDictionary< ValueType >::operator<< | ( | CValueTypePR | v | ) |
\short Adds a smart pointer to an object of type
ValueType
to the dictionary.
IlsNullPointerEncountered | If the smart pointer passed to this operator is null. |
IlsAlreadyInDictionary | If the dictionary already contains an object with the same identifier as the one you are trying to add. |
IlsAddingToOpenTable | If you try to add an object to a dictionary to which an iterator points. |
Myself& IlsDictionary< ValueType >::operator>> | ( | CValueTypePR | ) |
This extraction operator removes the smart pointer to an object of type ValueType
from the dictionary.
IlsNullPointerEncountered | If the smart pointer passed to this operator is null. |
IlsNotFound | If no object corresponds to the smart pointer passed to the operator. |
IlsRemovingFromOpenTable | If you try to remove an object from a dictionary to which an iterator points. |
Myself& IlsDictionary< ValueType >::suppress | ( | IlsCIdentifierR | , |
IlsBoolean | notify_destruction = IlsTrue |
||
) |
\short Removes the object that matches the identifier
passed as its argument from the dictionary.
IlsNullPointerEncountered | If the identifier passed to this function is a null smart pointer. |
IlsNotFound | If no object corresponds to the identifier passed to the function. |
IlsRemovingFromOpenTable | If you try to remove an object from a dictionary to which an iterator points. |