NEST  2.6.0,not_revisioned_source_dir@0
Modules | Classes
Handling classes Token and Dictionary.

Accessing the underlying vales of class Token and Dictionary entries can be a somewhat tricky issue, depending on how the data type is actually implemented. More...

Modules

 How to access the value contained in a Token contained in a dictionary.
 Class Dictionary defines the standard user interface for accessing tokens from dictionaries (see there).
 
 How to access the value contained in a Token.
 Class Token defines the standard user interface for accessing SLI Datum types from tokens (see there).
 

Classes

class  Dictionary
 A class that associates names and tokens. More...
 
class  Token
 A type-independent container for C++-types. More...
 

Detailed Description

Accessing the underlying vales of class Token and Dictionary entries can be a somewhat tricky issue, depending on how the data type is actually implemented.

The programmer needs detailed knowledge of the implementation (which usually involves an intermediate class which is derived from the generic class Datum.) However, the programmer in almost all cases is only interested in how to get and modify the underlying fundamental C++-types.

The utility functions described in this group aim at simplifying the access to the underlying values by providing template specializations for each fundamental C++-type. The programmer can simply specify the fundamental C++-type to handle, while the implementation details are hidden.

Note
Some of the utility functions described here have since been superceded by new type conversion operators in class Token (see there). These operators allow to use class Token directly at positions, where a fundamental C++-datatype is required. Together with the indexing operator for class Dictionary, it all boils down to comprehensive calls like the following:
int myvar = dict["myentry"];
dict["entry2"] = 23;
Token1 = Token2 + 1
It is left to the programmer's choice what method to use. It is recommendable to use the (implicit) type conversion operators where their operation is obvious to the reader of the source code. Sometimes using the type conversion operators tends to obscure the meaning of code. In these cases, the programmer is kindly asked to comment on the code, or to use the more explicit template functions described in this group.
R. Kupper, 24-09-2003