FreeFOAM The Cross-Platform CFD Toolkit
NamedEnum< Enum, nEnum > Class Template Reference

Initialise the NamedEnum HashTable from the static list of names. More...

#include <OpenFOAM/NamedEnum.H>


Detailed Description

template<class Enum, int nEnum>
class Foam::NamedEnum< Enum, nEnum >

Initialise the NamedEnum HashTable from the static list of names.

Source files

Definition at line 51 of file NamedEnum.H.

+ Inheritance diagram for NamedEnum< Enum, nEnum >:
+ Collaboration diagram for NamedEnum< Enum, nEnum >:

List of all members.

Public Member Functions

 NamedEnum ()
 Construct from names.
Enum read (Istream &) const
 Read a word from Istream and return the corresponding.
void write (const Enum e, Ostream &) const
 Write the name representation of the enumeration to an Ostream.
const Enum operator[] (const char *name) const
 Return the enumeration element corresponding to the given name.
const Enum operator[] (const word &name) const
 Return the enumeration element corresponding to the given name.
const char * operator[] (const Enum e) const
 Return the name of the given enumeration element.
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
template<>
const char * names []
- Public Member Functions inherited from HashTable< int >
bool set (const word &, const int &newElmt)
 Assign a new hashedEntry, overwriting existing entries.
 HashTable (const label size=128)
 Construct given initial table size.
 HashTable (Istream &, const label size=128)
 Construct from Istream.
 HashTable (const HashTable< int, word, string::hash > &)
 Construct as copy.
 HashTable (const Xfer< HashTable< int, word, string::hash > > &)
 Construct by transferring the parameter contents.
 ~HashTable ()
label size () const
 Return number of elements in table.
bool empty () const
 Return true if the hash table is empty.
bool found (const word &) const
 Return true if hashedEntry is found in table.
iterator find (const word &)
 Find and return an iterator set at the hashedEntry.
const_iterator find (const word &) const
 Find and return an const_iterator set at the hashedEntry.
List< wordtoc () const
 Return the table of contents.
List< wordsortedToc () const
 Return the table of contents as a sorted list.
OstreamprintInfo (Ostream &) const
 Print information.
bool insert (const word &, const int &newElmt)
 Insert a new hashedEntry.
bool erase (const iterator &)
 Erase an hashedEntry specified by given iterator.
bool erase (const word &)
 Erase an hashedEntry specified by given key if in table.
label erase (const UList< word > &)
 Remove entries given by the listed keys from this HashTable.
label erase (const HashTable< AnyType, word, AnyHash > &)
 Remove entries given by the given keys from this HashTable.
void resize (const label newSize)
 Resize the hash table for efficiency.
void clear ()
 Clear all entries from table.
void clearStorage ()
 Clear the table entries and the table itself.
void transfer (HashTable< int, word, string::hash > &)
 Transfer the contents of the argument table into this table.
Xfer< HashTable< int, word,
string::hash > > 
xfer ()
 Transfer contents to the Xfer container.
int & operator[] (const word &)
 Find and return an hashedEntry.
int & operator() (const word &)
 Find and return an hashedEntry, create it null if not present.
void operator= (const HashTable< int, word, string::hash > &)
 Assignment.
bool operator== (const HashTable< int, word, string::hash > &) const
 Equality. Two hash tables are equal if all contents of first are.
bool operator!= (const HashTable< int, word, string::hash > &) const
 The opposite of the equality operation. Takes linear time.
iterator begin ()
 iterator set to the begining of the HashTable
const_iterator begin () const
 const_iterator set to the beginning of the HashTable
const iterator & end ()
 iterator set to beyond the end of the HashTable
const const_iterator & end () const
 const_iterator set to beyond the end of the HashTable
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable
const const_iterator & cend () const
 const_iterator set to beyond the end of the HashTable

Static Public Attributes

static const char * names [nEnum]
 The set of names corresponding to the enumeration Enum.

Additional Inherited Members

- Public Types inherited from HashTable< int >
typedef int value_type
 Type of values the HashTable contains.
typedef int & reference
 Type that can be used for storing into HashTable::value_type.
typedef const int & const_reference
 Type that can be used for storing into constant.
typedef label size_type
 The type that can represent the size of a HashTable.

Constructor & Destructor Documentation


Member Function Documentation

Enum read ( Istream is) const

Read a word from Istream and return the corresponding.

enumeration element

Definition at line 62 of file NamedEnum.C.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, and Foam::name().

Referenced by Time::readDict().

void write ( const Enum  e,
Ostream os 
) const

Write the name representation of the enumeration to an Ostream.

Definition at line 82 of file NamedEnum.C.

const Enum operator[] ( const char *  name) const
inline

Return the enumeration element corresponding to the given name.

Definition at line 94 of file NamedEnum.H.

const Enum operator[] ( const word name) const
inline

Return the enumeration element corresponding to the given name.

Reimplemented from HashTable< int >.

Definition at line 100 of file NamedEnum.H.

const char* operator[] ( const Enum  e) const
inline

Return the name of the given enumeration element.

Definition at line 106 of file NamedEnum.H.

const char * names ( )
const char * names ( )

Definition at line 40 of file directions.C.

const char * names ( )

Definition at line 52 of file slidingInterface.C.

const char * names ( )

Definition at line 44 of file surfaceDisplacementPointPatchVectorField.C.

const char * names ( )
const char * names ( )

Definition at line 31 of file phaseProperties.C.

const char * names ( )

Definition at line 44 of file directMappedPatchBase.C.

const char * names ( )

Definition at line 56 of file distributedTriSurfaceMesh.C.

const char * names ( )

Definition at line 55 of file faceToCell.C.

const char * names ( )

Definition at line 55 of file faceZoneToCell.C.

const char * names ( )

Definition at line 54 of file pointToCell.C.

const char * names ( )

Definition at line 56 of file cellToFace.C.

const char * names ( )

Definition at line 56 of file pointToFace.C.

const char * names ( )

Definition at line 54 of file cellToPoint.C.

const char * names ( )

Definition at line 54 of file faceToPoint.C.

const char * names ( )

Definition at line 103 of file topoSetSource.C.

const char * names ( )

Definition at line 35 of file outputFilterOutputControl.C.

const char * names ( )

Definition at line 35 of file Pstream.C.

const char * names ( )

Definition at line 36 of file Time.C.

const char * names ( )

Definition at line 48 of file Time.C.

const char * names ( )

Definition at line 36 of file coupledPolyPatch.C.

const char * names ( )

Definition at line 35 of file intersection.C.

const char * names ( )

Definition at line 45 of file intersection.C.

const char * names ( )

Definition at line 31 of file fieldAverageItem.C.

const char * names ( )

Definition at line 41 of file fieldMinMax.C.

const char * names ( )

Definition at line 43 of file alphaContactAngleFvPatchScalarField.C.


Member Data Documentation

const char* names[nEnum]
static

The set of names corresponding to the enumeration Enum.

Definition at line 72 of file NamedEnum.H.


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