OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

NamedEnum Class Template Reference

Inheritance diagram for NamedEnum:

Inheritance graph
[legend]
Collaboration diagram for NamedEnum:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class Enum, int nEnum>
class Foam::NamedEnum< Enum, nEnum >

Definition at line 57 of file NamedEnum.H.


Public Member Functions

 NamedEnum ()
 Construct from names.
const Enum read (Istream &is) const
 Read a word from Istream and return the corresponding.
const Enum operator[] (const char *name) const
 Return the enumeration element corresponding to the given name.
const Enum operator[] (const word &name) const
 Return the enumeration element corresponding to the given name.
const char * operator[] (const Enum e) const
 Return the name or the given enumeration element.

Static Public Attributes

static const char * names [nEnum]
 The set of names corresponding to the enumeration Enum.

Constructor & Destructor Documentation

NamedEnum (  ) 

Construct from names.


Member Function Documentation

const Enum read ( Istream &  is  )  const [inline]

Read a word from Istream and return the corresponding.

enumeration element

Definition at line 90 of file NamedEnum.H.

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

Return the enumeration element corresponding to the given name.

Definition at line 113 of file NamedEnum.H.

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

Return the enumeration element corresponding to the given name.

Reimplemented from HashTable< int >.

Definition at line 119 of file NamedEnum.H.

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

Return the name or the given enumeration element.

Definition at line 125 of file NamedEnum.H.


Member Data Documentation

const char* names[nEnum] [static]

The set of names corresponding to the enumeration Enum.

Definition at line 75 of file NamedEnum.H.


The documentation for this class was generated from the following file: Copyright © 2000-2007 OpenCFD Ltd