FreeFOAM The Cross-Platform CFD Toolkit
DictionaryBase< IDLListType, T > Class Template Reference

Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it holds. More...

#include <OpenFOAM/DictionaryBase.H>


Detailed Description

template<class IDLListType, class T>
class Foam::DictionaryBase< IDLListType, T >

Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it holds.

The double templating allows for the instantiation of forms with or without storage management.

Note:
The IDLListType parameter should itself be a template but this confused gcc 2.95.2 so it has to be instantiated for T when an instantiation of DictionaryBase is requested
See also:
Dictionary and UDictionary
Source files

Definition at line 73 of file DictionaryBase.H.

+ Inheritance diagram for DictionaryBase< IDLListType, T >:

List of all members.

Public Member Functions

 DictionaryBase ()
 Null constructor.
 DictionaryBase (const DictionaryBase &)
 Copy construct.
template<class INew >
 DictionaryBase (Istream &, const INew &)
 Construct from Istream using given Istream constructor class.
 DictionaryBase (Istream &)
 Construct from Istream using default Istream constructor class.
bool found (const word &) const
 Search DictionaryBase for given keyword.
const TlookupPtr (const word &) const
 Find and return an entry if present, otherwise return NULL.
TlookupPtr (const word &)
 Find and return an entry if present, otherwise return NULL.
const Tlookup (const word &) const
 Find and return entry.
Tlookup (const word &)
 Find and return entry.
wordList toc () const
 Return the table of contents.
void insert (const word &, T *)
 Add at head of dictionary.
void append (const word &, T *)
 Add at tail of dictionary.
Tremove (const word &)
 Remove and return entry specified by keyword.
void clear ()
 Clear the dictionary.
void transfer (DictionaryBase< IDLListType, T > &)
 Transfer the contents of the argument into this DictionaryBase.
void operator= (const DictionaryBase &)
const Toperator[] (const word &key) const
 Find and return entry.
Toperator[] (const word &key)
 Find and return entry.

Friends

Ostreamoperator (Ostream &, const DictionaryBase< IDLListType, T > &)

Constructor & Destructor Documentation

Null constructor.

Definition at line 48 of file DictionaryBase.C.

DictionaryBase ( const DictionaryBase< IDLListType, T > &  dict)

Copy construct.

Definition at line 54 of file DictionaryBase.C.

DictionaryBase ( Istream is,
const INew iNew 
)

Construct from Istream using given Istream constructor class.

Definition at line 67 of file DictionaryBase.C.

Construct from Istream using default Istream constructor class.

Definition at line 79 of file DictionaryBase.C.


Member Function Documentation

bool found ( const word keyword) const

Search DictionaryBase for given keyword.

Definition at line 91 of file DictionaryBase.C.

References DictionaryBase< IDLListType, T >::found().

Referenced by DictionaryBase< IDLListType, T >::found().

const T * lookupPtr ( const word keyword) const

Find and return an entry if present, otherwise return NULL.

Definition at line 100 of file DictionaryBase.C.

References HashTable< T, Key, Hash >::end(), and HashTable< T, Key, Hash >::find().

T * lookupPtr ( const word keyword)

Find and return an entry if present, otherwise return NULL.

Definition at line 119 of file DictionaryBase.C.

References HashTable< T, Key, Hash >::end(), and HashTable< T, Key, Hash >::find().

const T * lookup ( const word keyword) const
T * lookup ( const word keyword)
Foam::wordList toc ( ) const

Return the table of contents.

Definition at line 174 of file DictionaryBase.C.

void insert ( const word keyword,
T tPtr 
)

Add at head of dictionary.

Definition at line 195 of file DictionaryBase.C.

References insert().

void append ( const word keyword,
T tPtr 
)

Add at tail of dictionary.

Definition at line 205 of file DictionaryBase.C.

References append().

T * remove ( const word keyword)

Remove and return entry specified by keyword.

Return NULL if the keyword was not found.

Definition at line 214 of file DictionaryBase.C.

References HashTable< T, Key, Hash >::end(), HashTable< T, Key, Hash >::find(), and Foam::T().

void clear ( )

Clear the dictionary.

Definition at line 232 of file DictionaryBase.C.

References clear().

void transfer ( DictionaryBase< IDLListType, T > &  dict)

Transfer the contents of the argument into this DictionaryBase.

and annull the argument.

Definition at line 241 of file DictionaryBase.C.

void operator= ( const DictionaryBase< IDLListType, T > &  )

Definition at line 254 of file DictionaryBase.C.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

const T* operator[] ( const word key) const
inline

Find and return entry.

Definition at line 154 of file DictionaryBase.H.

T* operator[] ( const word key)
inline

Find and return entry.

Definition at line 160 of file DictionaryBase.H.


Friends And Related Function Documentation

Ostream& operator ( Ostream ,
const DictionaryBase< IDLListType, T > &   
)
friend

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