Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
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 >:
Collaboration graph
[legend]

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 []
 
- 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 > &)
 Construct as copy. More...
 
 HashTable (const Xfer< HashTable< unsigned int, word, string::hash >> &)
 Construct by transferring the parameter contents. More...
 
 HashTable (std::initializer_list< Tuple2< word, unsigned int >>)
 Construct from an initializer 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...
 
Xfer< HashTable< unsigned int, word, string::hash > > xfer ()
 Transfer contents to the Xfer container. 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. More...
 
void operator= (std::initializer_list< Tuple2< word, unsigned int >>)
 Assignment to an initializer 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(), solidificationMeltingSource::read(), addfileModificationCheckingToOpt::readData(), addcommsTypeToOpt::readData(), Time::readDict(), and sampledPatchInternalField::sampledPatchInternalField().

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< directionType, 3 >::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/66]

const char * names ( )

Definition at line 39 of file EDCs.C.

◆ names() [2/66]

const char * names ( )

Definition at line 46 of file directions.C.

◆ names() [3/66]

const char * names ( )

Definition at line 41 of file tetDecomposer.C.

◆ names() [4/66]

const char * names ( )

Definition at line 54 of file slidingInterface.C.

◆ names() [5/66]

const char * names ( )

Definition at line 37 of file coordSet.C.

◆ names() [6/66]

const char * names ( )

Definition at line 41 of file vtkUnstructuredReader.C.

◆ names() [7/66]

const char * names ( )

Definition at line 58 of file vtkUnstructuredReader.C.

◆ names() [8/66]

const char * names ( )

Definition at line 70 of file vtkUnstructuredReader.C.

◆ names() [9/66]

const char * names ( )

Definition at line 40 of file fanPressureFvPatchScalarField.C.

◆ names() [10/66]

const char * names ( )

Definition at line 45 of file waveSurfacePressureFvPatchScalarField.C.

◆ names() [11/66]

const char * names ( )

Definition at line 46 of file volRegion.C.

◆ names() [12/66]

const char * names ( )

Definition at line 45 of file fieldAverageItem.C.

◆ names() [13/66]

const char * names ( )

Definition at line 46 of file fieldMinMax.C.

◆ names() [14/66]

const char * names ( )

Definition at line 48 of file fieldValueDelta.C.

◆ names() [15/66]

const char * names ( )

Definition at line 57 of file surfaceFieldValue.C.

◆ names() [16/66]

const char * names ( )

Definition at line 69 of file surfaceFieldValue.C.

◆ names() [17/66]

const char * names ( )

Definition at line 52 of file volFieldValue.C.

◆ names() [18/66]

const char * names ( )

Definition at line 46 of file streamLine.C.

◆ names() [19/66]

const char * names ( )

Definition at line 53 of file turbulenceFields.C.

◆ names() [20/66]

const char * names ( )

Definition at line 77 of file turbulenceFields.C.

◆ names() [21/66]

const char * names ( )

Definition at line 56 of file abort.C.

◆ names() [22/66]

const char * names ( )

Definition at line 53 of file writeObjects.C.

◆ names() [23/66]

const char * names ( )

Definition at line 44 of file surfaceDisplacementPointPatchVectorField.C.

◆ names() [24/66]

const char * names ( )

◆ names() [25/66]

const char * names ( )

Definition at line 42 of file cellSetOption.C.

◆ names() [26/66]

const char * names ( )

Definition at line 44 of file solidificationMeltingSource.C.

◆ names() [27/66]

const char * names ( )

Definition at line 37 of file phaseProperties.C.

◆ names() [28/66]

const char * names ( )

Definition at line 70 of file meshRefinement.C.

◆ names() [29/66]

const char * names ( )

Definition at line 84 of file meshRefinement.C.

◆ names() [30/66]

const char * names ( )

Definition at line 94 of file meshRefinement.C.

◆ names() [31/66]

const char * names ( )

Definition at line 41 of file surfaceZonesInfo.C.

◆ names() [32/66]

const char * names ( )

Definition at line 60 of file surfaceZonesInfo.C.

◆ names() [33/66]

const char * names ( )

Definition at line 45 of file shellSurfaces.C.

◆ names() [34/66]

const char * names ( )

Definition at line 33 of file faceAreaIntersect.C.

◆ names() [35/66]

const char * names ( )

Definition at line 47 of file extendedEdgeMesh.C.

◆ names() [36/66]

const char * names ( )

Definition at line 60 of file extendedEdgeMesh.C.

◆ names() [37/66]

const char * names ( )

Definition at line 75 of file extendedEdgeMesh.C.

◆ names() [38/66]

const char * names ( )

Definition at line 57 of file mappedPatchBase.C.

◆ names() [39/66]

const char * names ( )

Definition at line 72 of file mappedPatchBase.C.

◆ names() [40/66]

const char * names ( )

Definition at line 44 of file faceToCell.C.

◆ names() [41/66]

const char * names ( )

Definition at line 43 of file faceZoneToCell.C.

◆ names() [42/66]

const char * names ( )

Definition at line 44 of file pointToCell.C.

◆ names() [43/66]

const char * names ( )

Definition at line 46 of file cellToFace.C.

◆ names() [44/66]

const char * names ( )

Definition at line 44 of file pointToFace.C.

◆ names() [45/66]

const char * names ( )

Definition at line 44 of file cellToPoint.C.

◆ names() [46/66]

const char * names ( )

Definition at line 44 of file faceToPoint.C.

◆ names() [47/66]

const char * names ( )

Definition at line 43 of file topoSetSource.C.

◆ names() [48/66]

const char * names ( )

Definition at line 37 of file volumeType.C.

◆ names() [49/66]

const char * names ( )

Definition at line 41 of file IOobject.C.

◆ names() [50/66]

const char * names ( )

Definition at line 43 of file UPstream.C.

◆ names() [51/66]

const char * names ( )

Definition at line 44 of file Time.C.

◆ names() [52/66]

const char * names ( )

Definition at line 57 of file Time.C.

◆ names() [53/66]

const char * names ( )

Definition at line 51 of file fileOperation.C.

◆ names() [54/66]

const char * names ( )

Definition at line 40 of file coupledPolyPatch.C.

◆ names() [55/66]

const char * names ( )

Definition at line 39 of file intersection.C.

◆ names() [56/66]

const char * names ( )

Definition at line 50 of file intersection.C.

◆ names() [57/66]

const char * names ( )

Definition at line 60 of file fileMonitor.C.

◆ names() [58/66]

const char * names ( )

Definition at line 59 of file distributedTriSurfaceMesh.C.

◆ names() [59/66]

const char * names ( )

Definition at line 40 of file energyRegionCoupledFvPatchScalarField.C.

◆ names() [60/66]

const char * names ( )

Definition at line 42 of file meshToMesh.C.

◆ names() [61/66]

const char * names ( )

Definition at line 49 of file sampledTriSurfaceMesh.C.

◆ names() [62/66]

const char * names ( )

Definition at line 42 of file nastranSurfaceWriter.C.

◆ names() [63/66]

const char * names ( )

Definition at line 45 of file radiationCoupledBase.C.

◆ names() [64/66]

const char * names ( )

Definition at line 42 of file alphaContactAngleFvPatchScalarField.C.

◆ names() [65/66]

const char * names ( )

◆ names() [66/66]

const char * names ( )

Definition at line 41 of file temperatureCoupledBase.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: