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 []
 
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 nastranSurfaceWriter::nastranSurfaceWriter(), 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/70]

const char * names ( )

Definition at line 32 of file EDC.C.

◆ names() [2/70]

const char * names ( )

Definition at line 46 of file directions.C.

◆ names() [3/70]

const char * names ( )

Definition at line 41 of file tetDecomposer.C.

◆ names() [4/70]

const char * names ( )

Definition at line 54 of file slidingInterface.C.

◆ names() [5/70]

const char * names ( )

Definition at line 42 of file vtkUnstructuredReader.C.

◆ names() [6/70]

const char * names ( )

Definition at line 59 of file vtkUnstructuredReader.C.

◆ names() [7/70]

const char * names ( )

Definition at line 71 of file vtkUnstructuredReader.C.

◆ names() [8/70]

const char * names ( )

Definition at line 40 of file fanPressureFvPatchScalarField.C.

◆ names() [9/70]

const char * names ( )

Definition at line 45 of file waveSurfacePressureFvPatchScalarField.C.

◆ names() [10/70]

const char * names ( )

Definition at line 46 of file volRegion.C.

◆ names() [11/70]

const char * names ( )

Definition at line 37 of file fvCellSet.C.

◆ names() [12/70]

const char * names ( )

Definition at line 47 of file fieldAverage.C.

◆ names() [13/70]

const char * names ( )

Definition at line 48 of file fieldValueDelta.C.

◆ names() [14/70]

const char * names ( )

Definition at line 55 of file surfaceFieldValue.C.

◆ names() [15/70]

const char * names ( )

Definition at line 67 of file surfaceFieldValue.C.

◆ names() [16/70]

const char * names ( )

Definition at line 52 of file volFieldValue.C.

◆ names() [17/70]

const char * names ( )

Definition at line 47 of file streamlines.C.

◆ names() [18/70]

const char * names ( )

Definition at line 53 of file turbulenceFields.C.

◆ names() [19/70]

const char * names ( )

Definition at line 76 of file turbulenceFields.C.

◆ names() [20/70]

const char * names ( )

Definition at line 45 of file stopAt.C.

◆ names() [21/70]

const char * names ( )

Definition at line 53 of file writeObjects.C.

◆ names() [22/70]

const char * names ( )

Definition at line 47 of file rotorDiskSource.C.

◆ names() [23/70]

const char * names ( )

Definition at line 57 of file rotorDiskSource.C.

◆ names() [24/70]

const char * names ( )

Definition at line 44 of file solidificationMeltingSource.C.

◆ names() [25/70]

const char * names ( )

Definition at line 49 of file semiImplicitSource.C.

◆ names() [26/70]

const char * names ( )

Definition at line 44 of file surfaceDisplacementPointPatchVectorField.C.

◆ names() [27/70]

const char * names ( )

◆ names() [28/70]

const char * names ( )

Definition at line 37 of file phaseProperties.C.

◆ names() [29/70]

const char * names ( )

Definition at line 70 of file meshRefinement.C.

◆ names() [30/70]

const char * names ( )

Definition at line 84 of file meshRefinement.C.

◆ names() [31/70]

const char * names ( )

Definition at line 94 of file meshRefinement.C.

◆ names() [32/70]

const char * names ( )

Definition at line 40 of file refinementRegions.C.

◆ names() [33/70]

const char * names ( )

Definition at line 41 of file surfaceZonesInfo.C.

◆ names() [34/70]

const char * names ( )

Definition at line 60 of file surfaceZonesInfo.C.

◆ names() [35/70]

const char * names ( )

Definition at line 34 of file faceAreaIntersect.C.

◆ names() [36/70]

const char * names ( )

Definition at line 47 of file extendedEdgeMesh.C.

◆ names() [37/70]

const char * names ( )

Definition at line 60 of file extendedEdgeMesh.C.

◆ names() [38/70]

const char * names ( )

Definition at line 75 of file extendedEdgeMesh.C.

◆ names() [39/70]

const char * names ( )

Definition at line 57 of file mappedPatchBase.C.

◆ names() [40/70]

const char * names ( )

Definition at line 72 of file mappedPatchBase.C.

◆ names() [41/70]

const char * names ( )

Definition at line 44 of file faceToCell.C.

◆ names() [42/70]

const char * names ( )

Definition at line 43 of file faceZoneToCell.C.

◆ names() [43/70]

const char * names ( )

Definition at line 44 of file pointToCell.C.

◆ names() [44/70]

const char * names ( )

Definition at line 47 of file cellToFace.C.

◆ names() [45/70]

const char * names ( )

Definition at line 44 of file pointToFace.C.

◆ names() [46/70]

const char * names ( )

Definition at line 39 of file planeToFaceZone.C.

◆ names() [47/70]

const char * names ( )

Definition at line 44 of file cellToPoint.C.

◆ names() [48/70]

const char * names ( )

Definition at line 44 of file faceToPoint.C.

◆ names() [49/70]

const char * names ( )

Definition at line 43 of file topoSetSource.C.

◆ names() [50/70]

const char * names ( )

Definition at line 37 of file volumeType.C.

◆ names() [51/70]

const char * names ( )

Definition at line 38 of file IOobject.C.

◆ names() [52/70]

const char * names ( )

Definition at line 38 of file UPstream.C.

◆ names() [53/70]

const char * names ( )

Definition at line 40 of file Time.C.

◆ names() [54/70]

const char * names ( )

Definition at line 53 of file Time.C.

◆ names() [55/70]

const char * names ( )

Definition at line 46 of file fileOperation.C.

◆ names() [56/70]

const char * names ( )

Definition at line 35 of file cyclicTransform.C.

◆ names() [57/70]

const char * names ( )

Definition at line 39 of file intersection.C.

◆ names() [58/70]

const char * names ( )

Definition at line 50 of file intersection.C.

◆ names() [59/70]

const char * names ( )

Definition at line 34 of file tableBase.C.

◆ names() [60/70]

const char * names ( )

Definition at line 60 of file fileMonitor.C.

◆ names() [61/70]

const char * names ( )

Definition at line 59 of file distributedTriSurfaceMesh.C.

◆ names() [62/70]

const char * names ( )

Definition at line 46 of file radiationCoupledBase.C.

◆ names() [63/70]

const char * names ( )

Definition at line 37 of file coordSet.C.

◆ names() [64/70]

const char * names ( )

Definition at line 42 of file meshToMesh.C.

◆ names() [65/70]

const char * names ( )

Definition at line 44 of file isoSurface.C.

◆ names() [66/70]

const char * names ( )

Definition at line 69 of file sampledTriSurfaceMesh.C.

◆ names() [67/70]

const char * names ( )

Definition at line 41 of file nastranSurfaceWriter.C.

◆ names() [68/70]

const char * names ( )

◆ names() [69/70]

const char * names ( )

◆ names() [70/70]

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: