Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Classes | Public Types | Public Member Functions
IlsDictionary< ValueType > Class Template Reference

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

Myselfclear ()
 
ValueTypeP get (IlsCIdentifierR identifier) const
 
unsigned int getCount () const
 Returns the number of objects contained in the dictionary.
 
IlsBoolean isIn (IlsCIdentifierR identifier)
 
Myselfoperator<< (CValueTypePR v)
 
Myselfoperator>> (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.
 
Myselfsuppress (IlsCIdentifierR, IlsBoolean notify_destruction=IlsTrue)
 

Detailed Description

template<class ValueType>
class IlsDictionary< ValueType >

Class for storing objects of a given type with an identifier.

Template Parameters
ValueTypeClass 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:

IlsIdentifier getIdentifier() const;

The class IlsEntity contains this member function by default.

See also
IlsException, IlsDictionary::Iterator, IlsEntity, IlsObject.

Member Function Documentation

◆ clear()

template<class ValueType >
Myself& IlsDictionary< ValueType >::clear ( )
\short Empties the dictionary.
Exceptions
IlsClearingOpenTableIf an iterator points to the dictionary when this function is called.

◆ get()

template<class ValueType >
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.

Exceptions
IlsNullPointerEncounteredIf the identifier passed to this function is a null smart pointer.

◆ isIn()

template<class ValueType >
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.

Exceptions
IlsNullPointerEncounteredIf the identifier passed to this function is a null smart pointer.

◆ operator<<()

template<class ValueType >
Myself& IlsDictionary< ValueType >::operator<< ( CValueTypePR  v)
\short Adds a smart pointer to an object of type

ValueType to the dictionary.

Exceptions
IlsNullPointerEncounteredIf the smart pointer passed to this operator is null.
IlsAlreadyInDictionaryIf the dictionary already contains an object with the same identifier as the one you are trying to add.
IlsAddingToOpenTableIf you try to add an object to a dictionary to which an iterator points.

◆ operator>>()

template<class ValueType >
Myself& IlsDictionary< ValueType >::operator>> ( CValueTypePR  )

This extraction operator removes the smart pointer to an object of type ValueType from the dictionary.

Exceptions
IlsNullPointerEncounteredIf the smart pointer passed to this operator is null.
IlsNotFoundIf no object corresponds to the smart pointer passed to the operator.
IlsRemovingFromOpenTableIf you try to remove an object from a dictionary to which an iterator points.

◆ suppress()

template<class ValueType >
Myself& IlsDictionary< ValueType >::suppress ( IlsCIdentifierR  ,
IlsBoolean  notify_destruction = IlsTrue 
)
\short Removes the object that matches the identifier

passed as its argument from the dictionary.

Exceptions
IlsNullPointerEncounteredIf the identifier passed to this function is a null smart pointer.
IlsNotFoundIf no object corresponds to the identifier passed to the function.
IlsRemovingFromOpenTableIf you try to remove an object from a dictionary to which an iterator points.
IlsString
Implements a null-terminated string.
Definition: sstring.h:126