Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
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 >:
Inheritance graph
[legend]
Collaboration diagram for DictionaryBase< IDLListType, T >:
Collaboration graph
[legend]

Public Member Functions

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

Protected Member Functions

void addEntries ()
 

Protected Attributes

HashTable< T * > hashedTs_
 HashTable of the entries held on the IDLListType for quick lookup. More...
 

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

Constructor & Destructor Documentation

DictionaryBase ( const label  size = 128)

Construct given initial table size.

Definition at line 48 of file DictionaryBase.C.

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

Here is the caller graph for this function:

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

Copy construct.

Definition at line 56 of file DictionaryBase.C.

References DictionaryBase< IDLListType, T >::addEntries(), and DictionaryBase< IDLListType, T >::DictionaryBase().

Here is the call graph for this function:

DictionaryBase ( Istream is,
const INew iNew 
)

Construct from Istream using given Istream constructor class.

Definition at line 69 of file DictionaryBase.C.

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

Here is the call graph for this function:

Construct from Istream using default Istream constructor class.

Definition at line 81 of file DictionaryBase.C.

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

Here is the call graph for this function:

Member Function Documentation

void addEntries ( )
protected

Definition at line 31 of file DictionaryBase.C.

Referenced by DictionaryBase< IDLListType, T >::DictionaryBase(), and DictionaryBase< IDLListType, T >::operator=().

Here is the caller graph for this function:

bool found ( const word keyword) const

Search DictionaryBase for given keyword.

Definition at line 93 of file DictionaryBase.C.

References HashTable< T, Key, Hash >::found(), DictionaryBase< IDLListType, T >::hashedTs_, DictionaryBase< IDLListType, T >::lookupPtr(), and Foam::T().

Here is the call graph for this function:

const T * lookupPtr ( const word keyword) const

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

Definition at line 102 of file DictionaryBase.C.

References HashTableCore::end(), HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.

Referenced by Foam::debug::addDebugObject(), Foam::debug::addDimensionedConstantObject(), Foam::debug::addDimensionSetObject(), Foam::debug::addInfoObject(), Foam::debug::addOptimisationObject(), DictionaryBase< IDLListType, T >::found(), and Time::readDict().

Here is the call graph for this function:

Here is the caller graph for this function:

T * lookupPtr ( const word keyword)

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

Definition at line 121 of file DictionaryBase.C.

References HashTableCore::end(), HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.

Here is the call graph for this function:

const T * lookup ( const word keyword) const

Find and return entry.

Definition at line 138 of file DictionaryBase.C.

References HashTableCore::end(), Foam::exit(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.

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

Here is the call graph for this function:

Here is the caller graph for this function:

T * lookup ( const word keyword)

Find and return entry.

Definition at line 157 of file DictionaryBase.C.

References HashTableCore::end(), Foam::exit(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), and DictionaryBase< IDLListType, T >::hashedTs_.

Here is the call graph for this function:

Foam::wordList toc ( ) const

Return the table of contents.

Definition at line 176 of file DictionaryBase.C.

void insert ( const word keyword,
T tPtr 
)

Add at head of dictionary.

Definition at line 197 of file DictionaryBase.C.

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

Here is the call graph for this function:

void append ( const word keyword,
T tPtr 
)

Add at tail of dictionary.

Definition at line 207 of file DictionaryBase.C.

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

Referenced by Foam::debug::addDebugObject(), Foam::debug::addDimensionedConstantObject(), Foam::debug::addDimensionSetObject(), Foam::debug::addInfoObject(), and Foam::debug::addOptimisationObject().

Here is the call graph for this function:

Here is the caller graph for this function:

T * remove ( const word keyword)

Remove and return entry specified by keyword.

Return NULL if the keyword was not found.

Definition at line 216 of file DictionaryBase.C.

References HashTableCore::end(), HashTable< T, Key, Hash >::erase(), HashTable< T, Key, Hash >::find(), DictionaryBase< IDLListType, T >::hashedTs_, and Foam::T().

Here is the call graph for this function:

void clear ( )

Clear the dictionary.

Definition at line 234 of file DictionaryBase.C.

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

Here is the call graph for this function:

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

Transfer the contents of the argument into this DictionaryBase.

and annul the argument.

Definition at line 243 of file DictionaryBase.C.

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

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

Here is the call graph for this function:

Here is the caller 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 156 of file DictionaryBase.H.

T* operator[] ( const word key)
inline

Find and return entry.

Definition at line 162 of file DictionaryBase.H.

Friends And Related Function Documentation

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

Member Data Documentation

HashTable<T*> hashedTs_
protected

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