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...
 
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 []
 
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 []
 
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< 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()

NamedEnum ( )

Construct from names.

Definition at line 31 of file NamedEnum.C.

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.

Referenced by patchInternalField::patchInternalField(), and Time::readDict().

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.

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

Referenced by mappedPatchBase::mappedPatchBase().

Here is the caller graph for this function:

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

Referenced by NamedEnum< compressibleField, 8 >::operator[]().

Here is the caller 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.

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

◆ names() [1/69]

const char * names ( )

Definition at line 32 of file EDC.C.

◆ names() [2/69]

const char * names ( )

Definition at line 46 of file directions.C.

◆ names() [3/69]

const char * names ( )

Definition at line 41 of file tetDecomposer.C.

◆ names() [4/69]

const char * names ( )

Definition at line 54 of file slidingInterface.C.

◆ names() [5/69]

const char * names ( )

Definition at line 42 of file vtkUnstructuredReader.C.

◆ names() [6/69]

const char * names ( )

Definition at line 59 of file vtkUnstructuredReader.C.

◆ names() [7/69]

const char * names ( )

Definition at line 71 of file vtkUnstructuredReader.C.

◆ names() [8/69]

const char * names ( )

Definition at line 40 of file fanPressureFvPatchScalarField.C.

◆ names() [9/69]

const char * names ( )

Definition at line 45 of file waveSurfacePressureFvPatchScalarField.C.

◆ names() [10/69]

const char * names ( )

Definition at line 46 of file volRegion.C.

◆ names() [11/69]

const char * names ( )

Definition at line 37 of file fvCellSet.C.

◆ names() [12/69]

const char * names ( )

Definition at line 48 of file fieldAverage.C.

◆ names() [13/69]

const char * names ( )

Definition at line 48 of file fieldValueDelta.C.

◆ names() [14/69]

const char * names ( )

Definition at line 58 of file surfaceFieldValue.C.

◆ names() [15/69]

const char * names ( )

Definition at line 70 of file surfaceFieldValue.C.

◆ names() [16/69]

const char * names ( )

Definition at line 52 of file volFieldValue.C.

◆ names() [17/69]

const char * names ( )

Definition at line 71 of file streamlines.C.

◆ names() [18/69]

const char * names ( )

Definition at line 53 of file turbulenceFields.C.

◆ names() [19/69]

const char * names ( )

Definition at line 76 of file turbulenceFields.C.

◆ names() [20/69]

const char * names ( )

Definition at line 71 of file scalarTransport.C.

◆ names() [21/69]

const char * names ( )

Definition at line 45 of file stopAt.C.

◆ names() [22/69]

const char * names ( )

Definition at line 53 of file writeObjects.C.

◆ names() [23/69]

const char * names ( )

Definition at line 47 of file rotorDiskSource.C.

◆ names() [24/69]

const char * names ( )

Definition at line 57 of file rotorDiskSource.C.

◆ names() [25/69]

const char * names ( )

Definition at line 44 of file solidificationMeltingSource.C.

◆ names() [26/69]

const char * names ( )

Definition at line 49 of file semiImplicitSource.C.

◆ names() [27/69]

const char * names ( )

Definition at line 44 of file surfaceDisplacementPointPatchVectorField.C.

◆ names() [28/69]

const char * names ( )

◆ names() [29/69]

const char * names ( )

Definition at line 37 of file phaseProperties.C.

◆ names() [30/69]

const char * names ( )

Definition at line 70 of file meshRefinement.C.

◆ names() [31/69]

const char * names ( )

Definition at line 84 of file meshRefinement.C.

◆ names() [32/69]

const char * names ( )

Definition at line 94 of file meshRefinement.C.

◆ names() [33/69]

const char * names ( )

Definition at line 40 of file refinementRegions.C.

◆ names() [34/69]

const char * names ( )

Definition at line 41 of file surfaceZonesInfo.C.

◆ names() [35/69]

const char * names ( )

Definition at line 60 of file surfaceZonesInfo.C.

◆ names() [36/69]

const char * names ( )

Definition at line 34 of file faceAreaIntersect.C.

◆ names() [37/69]

const char * names ( )

Definition at line 47 of file extendedEdgeMesh.C.

◆ names() [38/69]

const char * names ( )

Definition at line 60 of file extendedEdgeMesh.C.

◆ names() [39/69]

const char * names ( )

Definition at line 75 of file extendedEdgeMesh.C.

◆ names() [40/69]

const char * names ( )

Definition at line 57 of file mappedPatchBase.C.

◆ names() [41/69]

const char * names ( )

Definition at line 72 of file mappedPatchBase.C.

◆ names() [42/69]

const char * names ( )

Definition at line 43 of file faceToCell.C.

◆ names() [43/69]

const char * names ( )

Definition at line 42 of file faceZoneToCell.C.

◆ names() [44/69]

const char * names ( )

Definition at line 43 of file pointToCell.C.

◆ names() [45/69]

const char * names ( )

Definition at line 46 of file cellToFace.C.

◆ names() [46/69]

const char * names ( )

Definition at line 43 of file pointToFace.C.

◆ names() [47/69]

const char * names ( )

Definition at line 39 of file planeToFaceZone.C.

◆ names() [48/69]

const char * names ( )

Definition at line 43 of file cellToPoint.C.

◆ names() [49/69]

const char * names ( )

Definition at line 43 of file faceToPoint.C.

◆ names() [50/69]

const char * names ( )

Definition at line 42 of file topoSetSource.C.

◆ names() [51/69]

const char * names ( )

Definition at line 37 of file volumeType.C.

◆ names() [52/69]

const char * names ( )

Definition at line 38 of file IOobject.C.

◆ names() [53/69]

const char * names ( )

Definition at line 38 of file UPstream.C.

◆ names() [54/69]

const char * names ( )

Definition at line 41 of file Time.C.

◆ names() [55/69]

const char * names ( )

Definition at line 54 of file Time.C.

◆ names() [56/69]

const char * names ( )

Definition at line 46 of file fileOperation.C.

◆ names() [57/69]

const char * names ( )

Definition at line 35 of file cyclicTransform.C.

◆ names() [58/69]

const char * names ( )

Definition at line 39 of file intersection.C.

◆ names() [59/69]

const char * names ( )

Definition at line 50 of file intersection.C.

◆ names() [60/69]

const char * names ( )

Definition at line 34 of file tableBase.C.

◆ names() [61/69]

const char * names ( )

Definition at line 60 of file fileMonitor.C.

◆ names() [62/69]

const char * names ( )

Definition at line 59 of file distributedTriSurfaceMesh.C.

◆ names() [63/69]

const char * names ( )

Definition at line 46 of file radiationCoupledBase.C.

◆ names() [64/69]

const char * names ( )

Definition at line 34 of file coordSet.C.

◆ names() [65/69]

const char * names ( )

Definition at line 44 of file isoSurface.C.

◆ names() [66/69]

const char * names ( )

Definition at line 69 of file sampledTriSurfaceMesh.C.

◆ names() [67/69]

const char * names ( )

◆ names() [68/69]

const char * names ( )

Definition at line 33 of file basicChemistryModel.C.

◆ names() [69/69]

const char * names ( )

Definition at line 42 of file alphaContactAngleFvPatchScalarField.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.


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