OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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...

Inheritance diagram for DictionaryBase< IDLListType, T >:
Collaboration 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 T * lookupPtr (const word &) const
 Find and return an entry if present, otherwise return NULL.
T * lookupPtr (const word &)
 Find and return an entry if present, otherwise return NULL.
const T * lookup (const word &) const
 Find and return entry.
T * lookup (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.
T * remove (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 T * operator[] (const word &key) const
 Find and return entry.
T * operator[] (const word &key)
 Find and return entry.

Friends

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

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 68 of file DictionaryBase.H.


Constructor & Destructor Documentation

DictionaryBase (  )  [inline]

Null constructor.

Definition at line 40 of file DictionaryBase.C.

DictionaryBase ( const DictionaryBase< IDLListType, T > &  dict  )  [inline]

Copy construct.

Definition at line 46 of file DictionaryBase.C.

DictionaryBase ( Istream is,
const INew iNew 
) [inline]

Construct from Istream using given Istream constructor class.

Definition at line 59 of file DictionaryBase.C.

DictionaryBase ( Istream is  )  [inline]

Construct from Istream using default Istream constructor class.

Definition at line 71 of file DictionaryBase.C.


Member Function Documentation

bool found ( const word keyword  )  const [inline]

Search DictionaryBase for given keyword.

Definition at line 83 of file DictionaryBase.C.

const T * lookupPtr ( const word keyword  )  const [inline]

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

Definition at line 92 of file DictionaryBase.C.

References HashTable< T, Key, Hash >::found().

Here is the call graph for this function:

T * lookupPtr ( const word keyword  )  [inline]

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

Definition at line 111 of file DictionaryBase.C.

const T * lookup ( const word keyword  )  const [inline]

Find and return entry.

Definition at line 128 of file DictionaryBase.C.

Referenced by DictionaryBase< IDLList< T >, T >::operator[]().

Here is the caller graph for this function:

T * lookup ( const word keyword  )  [inline]

Find and return entry.

Definition at line 147 of file DictionaryBase.C.

Foam::wordList toc (  )  const [inline]

Return the table of contents.

Definition at line 166 of file DictionaryBase.C.

void insert ( const word keyword,
T *  tPtr 
) [inline]

Add at head of dictionary.

Definition at line 187 of file DictionaryBase.C.

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

Here is the caller graph for this function:

void append ( const word keyword,
T *  tPtr 
) [inline]

Add at tail of dictionary.

Definition at line 197 of file DictionaryBase.C.

References DictionaryBase< IDLListType, T >::insert(), and HashTable< T, Key, Hash >::insert().

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

Here is the call graph for this function:

Here is the caller graph for this function:

T * remove ( const word keyword  )  [inline]

Remove and return entry specified by keyword.

Return NULL if the keyword was not found.

Definition at line 206 of file DictionaryBase.C.

References DictionaryBase< IDLListType, T >::append(), and HashTable< T, Key, Hash >::insert().

Here is the call graph for this function:

void clear (  )  [inline]

Clear the dictionary.

Definition at line 224 of file DictionaryBase.C.

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

Here is the caller graph for this function:

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

Transfer the contents of the argument into this DictionaryBase.

and annull the argument.

Definition at line 233 of file DictionaryBase.C.

References DictionaryBase< IDLListType, T >::clear(), and HashTable< T, Key, Hash >::clear().

Here is the call graph for this function:

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

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

Find and return entry.

Definition at line 153 of file DictionaryBase.H.

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

Find and return entry.

Definition at line 159 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:
Copyright © 2000-2009 OpenCFD Ltd