NamedEnum< Enum, nEnum > Class Template Reference

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

Inherits HashTable< unsigned int >.

Collaboration diagram for NamedEnum< Enum, nEnum >:

Public Member Functions

 NamedEnum ()
 Construct from names. More...
 
Enum read (Istream &) const
 Read a word from Istream and return the corresponding. More...
 
void write (const Enum e, Ostream &) const
 Write the name representation of the enumeration to an Ostream. More...
 
const Enum operator[] (const char *name) const
 Return the enumeration element corresponding to the given name. More...
 
const Enum operator[] (const word &name) const
 Return the enumeration element corresponding to the given name. More...
 
const char * operator[] (const Enum e) const
 Return the name of the given enumeration element. More...
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
const char * names []
 
- Public Member Functions inherited from HashTable< unsigned int >
bool set (const word &, const unsigned int &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< unsigned int, word, string::hash > &)
 Copy constructor. More...
 
 HashTable (HashTable< unsigned int, word, string::hash > &&)
 Move constructor. More...
 
 HashTable (std::initializer_list< Tuple2< word, unsigned int >>)
 Construct from an initialiser list. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const word &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const word &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const word &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< wordtoc () const
 Return the table of contents. More...
 
List< wordsortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const word &, const unsigned int &newElmt)
 Insert a new hashedEntry. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const word &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< word > &)
 Remove entries given by the listed keys from this HashTable. More...
 
label erase (const HashTable< AnyType, word, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
Foam::label erase (const HashTable< AnyType, word, AnyHash > &rhs)
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< unsigned int, word, string::hash > &)
 Transfer the contents of the argument table into this table. More...
 
unsigned int & operator[] (const word &)
 Find and return a hashedEntry. More...
 
const unsigned int & operator[] (const word &) const
 Find and return a hashedEntry. More...
 
unsigned int & operator() (const word &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< unsigned int, word, string::hash > &)
 Assignment operator. More...
 
void operator= (HashTable< unsigned int, word, string::hash > &&)
 Move assignment operator. More...
 
void operator= (std::initializer_list< Tuple2< word, unsigned int >>)
 Assignment to an initialiser list. More...
 
bool operator== (const HashTable< unsigned int, word, string::hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< unsigned int, word, string::hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 
- Public Member Functions inherited from HashTableCore
 HashTableCore ()
 Construct null. More...
 
 ClassName ("HashTable")
 Define template name and debug. More...
 

Static Public Member Functions

static stringList strings ()
 The set of names as a list of strings. More...
 
static wordList words ()
 The set of names as a list of words. More...
 
- Static Public Member Functions inherited from HashTableCore
static label canonicalSize (const label)
 Return a canonical (power-of-two) size. More...
 
static iteratorEnd cend ()
 iteratorEnd set to beyond the end of any HashTable More...
 
static iteratorEnd end ()
 iteratorEnd set to beyond the end of any HashTable More...
 

Static Public Attributes

static const char * names [nEnum]
 The set of names corresponding to the enumeration Enum. More...
 
- Static Public Attributes inherited from HashTableCore
static const label maxTableSize
 Maximum allowable table size. More...
 

Additional Inherited Members

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

Detailed Description

template<class Enum, unsigned 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.

Constructor & Destructor Documentation

◆ NamedEnum()

Construct from names.

Definition at line 31 of file NamedEnum.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, HashTable< unsigned int >::insert(), and NamedEnum< Enum, nEnum >::names.

Here is the call graph for this function:

Member Function Documentation

◆ read()

Enum read ( Istream is) const

Read a word from Istream and return the corresponding.

enumeration element

Definition at line 61 of file NamedEnum.C.

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

Referenced by Time::readDict(), mappedInternalPatchBase::readOffsetMode(), and refinementRegions::refinementRegions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void write ( const Enum  e,
Ostream os 
) const

Write the name representation of the enumeration to an Ostream.

Definition at line 79 of file NamedEnum.C.

References Foam::e.

◆ strings()

Foam::stringList strings
static

The set of names as a list of strings.

Definition at line 86 of file NamedEnum.C.

◆ words()

Foam::wordList words
static

The set of names as a list of words.

Definition at line 105 of file NamedEnum.C.

◆ operator[]() [1/3]

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

Return the enumeration element corresponding to the given name.

Definition at line 97 of file NamedEnum.H.

References Foam::name().

Here is the call graph for this function:

◆ operator[]() [2/3]

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

Return the enumeration element corresponding to the given name.

Definition at line 103 of file NamedEnum.H.

References Foam::name().

Here is the call graph for this function:

◆ operator[]() [3/3]

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

Return the name of the given enumeration element.

Definition at line 124 of file NamedEnum.C.

References Foam::e, Foam::exit(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ names() [1/78]

const char * names

Definition at line 32 of file EDC.C.

◆ names() [2/78]

const char * names

Definition at line 46 of file directions.C.

◆ names() [3/78]

const char * names

Definition at line 41 of file tetDecomposer.C.

◆ names() [4/78]

const char * names

Definition at line 54 of file slidingInterface.C.

◆ names() [5/78]

const char * names

Definition at line 42 of file vtkUnstructuredReader.C.

◆ names() [6/78]

const char * names

Definition at line 59 of file vtkUnstructuredReader.C.

◆ names() [7/78]

const char * names

Definition at line 71 of file vtkUnstructuredReader.C.

◆ names() [8/78]

const char * names

Definition at line 40 of file fanPressureFvPatchScalarField.C.

◆ names() [9/78]

const char * names

Definition at line 45 of file waveSurfacePressureFvPatchScalarField.C.

◆ names() [10/78]

const char * names

Definition at line 48 of file fieldAverage.C.

◆ names() [11/78]

const char * names

Definition at line 48 of file fieldValueDelta.C.

◆ names() [12/78]

const char * names

Definition at line 59 of file surfaceFieldValue.C.

◆ names() [13/78]

const char * names

Definition at line 71 of file surfaceFieldValue.C.

◆ names() [14/78]

const char * names

Definition at line 53 of file volFieldValue.C.

◆ names() [15/78]

const char * names

Definition at line 73 of file streamlines.C.

◆ names() [16/78]

const char * names

Definition at line 53 of file turbulenceFields.C.

◆ names() [17/78]

const char * names

Definition at line 76 of file turbulenceFields.C.

◆ names() [18/78]

const char * names

Definition at line 71 of file scalarTransport.C.

◆ names() [19/78]

const char * names

Definition at line 45 of file stopAt.C.

◆ names() [20/78]

const char * names

Definition at line 53 of file writeObjects.C.

◆ names() [21/78]

const char * names

Definition at line 47 of file rotorDiskSource.C.

◆ names() [22/78]

const char * names

Definition at line 57 of file rotorDiskSource.C.

◆ names() [23/78]

const char * names

Definition at line 44 of file solidificationMeltingSource.C.

◆ names() [24/78]

const char * names

Definition at line 49 of file semiImplicitSource.C.

◆ names() [25/78]

const char * names

Definition at line 43 of file surfaceDisplacementPointPatchVectorField.C.

◆ names() [26/78]

const char * names

◆ names() [27/78]

const char * names

Definition at line 37 of file phaseProperties.C.

◆ names() [28/78]

const char * names

Definition at line 37 of file injectionModel.C.

◆ names() [29/78]

const char * names

Definition at line 70 of file meshRefinement.C.

◆ names() [30/78]

const char * names

Definition at line 84 of file meshRefinement.C.

◆ names() [31/78]

const char * names

Definition at line 94 of file meshRefinement.C.

◆ names() [32/78]

const char * names

Definition at line 39 of file refinementRegions.C.

◆ names() [33/78]

const char * names

Definition at line 41 of file surfaceZonesInfo.C.

◆ names() [34/78]

const char * names

Definition at line 60 of file surfaceZonesInfo.C.

◆ names() [35/78]

const char * names

Definition at line 47 of file extendedEdgeMesh.C.

◆ names() [36/78]

const char * names

Definition at line 60 of file extendedEdgeMesh.C.

◆ names() [37/78]

const char * names

Definition at line 75 of file extendedEdgeMesh.C.

◆ names() [38/78]

const char * names

Definition at line 48 of file mappedInternalPatchBase.C.

◆ names() [39/78]

const char * names

Definition at line 43 of file faceToCell.C.

◆ names() [40/78]

const char * names

Definition at line 42 of file faceZoneToCell.C.

◆ names() [41/78]

const char * names

Definition at line 43 of file pointToCell.C.

◆ names() [42/78]

const char * names

Definition at line 46 of file cellToFace.C.

◆ names() [43/78]

const char * names

Definition at line 43 of file pointToFace.C.

◆ names() [44/78]

const char * names

Definition at line 39 of file planeToFaceZone.C.

◆ names() [45/78]

const char * names

Definition at line 43 of file cellToPoint.C.

◆ names() [46/78]

const char * names

Definition at line 43 of file faceToPoint.C.

◆ names() [47/78]

const char * names

Definition at line 37 of file polyCellSet.C.

◆ names() [48/78]

const char * names

Definition at line 42 of file topoSetSource.C.

◆ names() [49/78]

const char * names

Definition at line 37 of file volumeType.C.

◆ names() [50/78]

const char * names

Definition at line 38 of file IOobject.C.

◆ names() [51/78]

const char * names

Definition at line 38 of file UPstream.C.

◆ names() [52/78]

const char * names

Definition at line 41 of file Time.C.

◆ names() [53/78]

const char * names

Definition at line 54 of file Time.C.

◆ names() [54/78]

const char * names

Definition at line 46 of file fileOperation.C.

◆ names() [55/78]

const char * names

Definition at line 64 of file cyclicTransform.C.

◆ names() [56/78]

const char * names

Definition at line 39 of file intersection.C.

◆ names() [57/78]

const char * names

Definition at line 50 of file intersection.C.

◆ names() [58/78]

const char * names

Definition at line 34 of file tableBase.C.

◆ names() [59/78]

const char * names

Definition at line 60 of file fileMonitor.C.

◆ names() [60/78]

const char * names

Definition at line 59 of file distributedTriSurfaceMesh.C.

◆ names() [61/78]

const char * names

Definition at line 46 of file radiationCoupledBase.C.

◆ names() [62/78]

const char * names

Definition at line 34 of file coordSet.C.

◆ names() [63/78]

const char * names

Definition at line 69 of file sampledTriSurfaceMesh.C.

◆ names() [64/78]

const char * names

◆ names() [65/78]

const char * names

Definition at line 33 of file basicChemistryModel.C.

◆ names() [66/78]

const char * names

Definition at line 40 of file contactAngleFvPatchScalarField.C.

◆ names() [67/78]

const char * names

Definition at line 37 of file CloudFilmTransferBase.C.

◆ names() [68/78]

const char * names

Definition at line 53 of file populationBalanceMoments.C.

◆ names() [69/78]

const char * names

Definition at line 72 of file populationBalanceMoments.C.

◆ names() [70/78]

const char * names

Definition at line 91 of file populationBalanceMoments.C.

◆ names() [71/78]

const char * names

Definition at line 115 of file populationBalanceMoments.C.

◆ names() [72/78]

const char * names

Definition at line 51 of file populationBalanceSizeDistribution.C.

◆ names() [73/78]

const char * names

Definition at line 73 of file populationBalanceSizeDistribution.C.

◆ names() [74/78]

const char * names

Definition at line 96 of file populationBalanceSizeDistribution.C.

◆ names() [75/78]

const char * names

◆ names() [76/78]

const char * names

Definition at line 37 of file heatTransferPhaseSystem.C.

◆ names() [77/78]

const char * names

Definition at line 37 of file twoResistanceHeatTransferPhaseSystem.C.

◆ names() [78/78]

const char * names

Definition at line 54 of file fractal.C.

Member Data Documentation

◆ names

const char* names[nEnum]
static

The set of names corresponding to the enumeration Enum.

Definition at line 69 of file NamedEnum.H.

Referenced by NamedEnum< Enum, nEnum >::NamedEnum().


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