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< 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 []
 
- Public Member Functions inherited from HashTable< int >
bool set (const word &, const 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< int, word, string::hash > &)
 Construct as copy. More...
 
 HashTable (const Xfer< HashTable< int, word, string::hash > > &)
 Construct by transferring the parameter contents. 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 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...
 
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< int, word, string::hash > &)
 Transfer the contents of the argument table into this table. More...
 
Xfer< HashTable< int, word, string::hash > > xfer ()
 Transfer contents to the Xfer container. More...
 
int & operator[] (const word &)
 Find and return a hashedEntry. More...
 
const int & operator[] (const word &) const
 Find and return a hashedEntry. More...
 
int & operator() (const word &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< int, word, string::hash > &)
 Assignment. More...
 
bool operator== (const HashTable< int, word, string::hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< 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< int >
typedef int value_type
 Type of values the HashTable contains. More...
 
typedef int & reference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef const 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, int nEnum>
class Foam::NamedEnum< Enum, nEnum >

Initialise the NamedEnum HashTable from the static list of names.

Source files

Definition at line 52 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, FatalErrorIn, HashTable< int >::insert(), and NamedEnum< Enum, nEnum >::names().

Here is the call graph for this function:

Member Function Documentation

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, FatalIOErrorIn, HashTable< int >::find(), Foam::name(), and HashTable< int >::sortedToc().

Referenced by nastranSurfaceWriter::nastranSurfaceWriter(), solidificationMeltingSource::read(), addfileModificationCheckingToOpt::readData(), addcommsTypeToOpt::readData(), Time::readDict(), and sampledPatchInternalField::sampledPatchInternalField().

Here is the call graph for this function:

Here is the caller graph for this function:

void write ( const Enum  e,
Ostream os 
) const

Write the name representation of the enumeration to an Ostream.

Definition at line 81 of file NamedEnum.C.

References NamedEnum< Enum, nEnum >::operator[]().

Here is the call graph for this function:

Foam::stringList strings ( )
static

The set of names as a list of strings.

Definition at line 88 of file NamedEnum.C.

References NamedEnum< Enum, nEnum >::names(), and List< T >::setSize().

Here is the call graph for this function:

Foam::wordList words ( )
static

The set of names as a list of words.

Definition at line 107 of file NamedEnum.C.

References NamedEnum< Enum, nEnum >::names(), and List< T >::setSize().

Referenced by mappedPatchBase::mappedPatchBase().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Return the enumeration element corresponding to the given name.

Definition at line 101 of file NamedEnum.H.

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

Here is the caller graph for this function:

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

Return the enumeration element corresponding to the given name.

Definition at line 107 of file NamedEnum.H.

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

Return the name of the given enumeration element.

Definition at line 113 of file NamedEnum.H.

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

Definition at line 47 of file extendedEdgeMesh.C.

const char * names ( )

Definition at line 60 of file extendedEdgeMesh.C.

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

Definition at line 37 of file coordSet.C.

References coordSet::coordSet().

Here is the call graph for this function:

const char * names ( )

Definition at line 41 of file vtkUnstructuredReader.C.

References vtkUnstructuredReader::vtkDataTypeNames.

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

Definition at line 45 of file waveSurfacePressureFvPatchScalarField.C.

References waveSurfacePressureFvPatchScalarField::waveSurfacePressureFvPatchScalarField().

Here is the call graph for this function:

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

Definition at line 42 of file cellSetOption.C.

References cellSetOption::selectionModeTypeNames_.

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

Definition at line 37 of file phaseProperties.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, found, Foam::mag(), Foam::nl, phaseProperties::phaseTypeNames, List< T >::setSize(), List< T >::size(), and Y0().

Here is the call graph for this function:

const char * names ( )

Definition at line 71 of file meshRefinement.C.

const char * names ( )

Definition at line 86 of file meshRefinement.C.

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

Definition at line 41 of file surfaceZonesInfo.C.

References surfaceZonesInfo::areaSelectionAlgoNames.

const char * names ( )

Definition at line 60 of file surfaceZonesInfo.C.

References surfaceZonesInfo::faceZoneTypeNames, and surfaceZonesInfo::surfaceZonesInfo().

Here is the call graph for this function:

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

Definition at line 57 of file mappedPatchBase.C.

const char * names ( )

Definition at line 72 of file mappedPatchBase.C.

References mappedPatchBase::facePoints(), mappedPatchBase::offsetModeNames_, and mappedPatchBase::sampleModeNames_.

Here is the call graph for this function:

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

Definition at line 45 of file pointToCell.C.

References Foam::add(), f(), forAll, forAllConstIter(), HashTable< T, Key, Hash >::found(), face::nextLabel(), and pointToCell::pointToCell().

Here is the call graph for this function:

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

Definition at line 45 of file cellToPoint.C.

References Foam::add(), cellToPoint::cellToPoint(), f(), forAll, and forAllConstIter().

Here is the call graph for this function:

const char * names ( )

Definition at line 45 of file faceToPoint.C.

References Foam::add(), f(), faceToPoint::faceToPoint(), forAll, and forAllConstIter().

Here is the call graph for this function:

const char * names ( )

Definition at line 43 of file topoSetSource.C.

References topoSetSource::New(), and topoSetSource::usageTablePtr_.

Here is the call graph for this function:

const char * names ( )

Definition at line 37 of file volumeType.C.

References volumeType::names.

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

Definition at line 43 of file Time.C.

const char * names ( )

Definition at line 56 of file Time.C.

References Time::controlDictName, Time::format_, Time::general, Foam::log10(), Time::maxPrecision_, Time::precision_, Time::stopAtControlNames_, and Time::writeControlNames_.

Here is the call graph for this function:

const char * names ( )

Definition at line 40 of file coupledPolyPatch.C.

References coupledPolyPatch::transformTypeNames.

const char * names ( )

Definition at line 39 of file intersection.C.

const char * names ( )

Definition at line 50 of file intersection.C.

References intersection::algorithmNames_, and intersection::directionNames_.

const char * names ( )

Definition at line 60 of file fileMonitor.C.

const char * names ( )

Definition at line 59 of file distributedTriSurfaceMesh.C.

References Foam::DelaunayMeshTools::allPoints(), List< T >::append(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), treeBoundBox::contains(), geomDecomp::decompose(), mapDistribute::distribute(), distributedTriSurfaceMesh::distributionTypeNames_, Foam::endl(), Foam::exit(), f(), Foam::FatalError, FatalErrorIn, FixedList< T, Size >::fcIndex(), Foam::findIndex(), indexedOctree< Type >::findLineAny(), forAll, Pstream::gatherList(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), Foam::identity(), triangleFuncs::intersectBb(), treeBoundBox::intersects(), Foam::invertManyToMany(), Foam::magSqr(), Foam::matchPoints(), Vector< Cmpt >::max, boundBox::max(), Foam::max(), Vector< Cmpt >::min, boundBox::min(), Foam::min(), IOobject::MUST_READ_IF_MODIFIED, UPstream::myProcNo(), n, decompositionMethod::New(), IOobject::NO_WRITE, UPstream::nProcs(), boundBox::overlaps(), UPstream::parRun(), triSurface::patches(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), Foam::readScalar(), Foam::reduce(), labelledTri::region(), Foam::returnReduce(), mapDistribute::reverseDistribute(), s(), Pstream::scatterList(), PointIndexHit< Point >::setIndex(), List< T >::setSize(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), List< T >::size(), Foam::system(), IOobject::time(), globalIndex::toGlobal(), globalIndex::toLocal(), List< T >::transfer(), globalIndex::whichProcID(), and List< T >::xfer().

const char * names ( )

Definition at line 40 of file fieldAverageItem.C.

const char * names ( )

Definition at line 40 of file fieldMinMax.C.

References fieldMinMax::fieldMinMax(), and fieldMinMax::modeTypeNames_.

Here is the call graph for this function:

const char * names ( )

Definition at line 36 of file cellSource.C.

const char * names ( )

Definition at line 44 of file cellSource.C.

const char * names ( )

Definition at line 42 of file faceSource.C.

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

Definition at line 43 of file fieldValueDelta.C.

References fieldValueDelta::fieldValueDelta(), and fieldValueDelta::operationTypeNames_.

Here is the call graph for this function:

const char * names ( )

Definition at line 50 of file abortCalculation.C.

References Foam::isFile(), UPstream::master(), Foam::reduce(), and Foam::rm().

Here is the call graph for this function:

const char * names ( )

Definition at line 38 of file turbulenceFields.C.

References turbulenceFields::compressibleFieldNames_.

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

Definition at line 49 of file sampledTriSurfaceMesh.C.

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

Definition at line 48 of file radiationCoupledBase.C.

References radiationCoupledBase::radiationCoupledBase().

Here is the call graph for this function:

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

Definition at line 41 of file temperatureCoupledBase.C.

References temperatureCoupledBase::KMethodTypeNames_, and temperatureCoupledBase::temperatureCoupledBase().

Here is the call graph for this function:

const char * names ( )

Member Data Documentation

const char* names[nEnum]
static

The set of names corresponding to the enumeration Enum.

Definition at line 73 of file NamedEnum.H.


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