phdMesh  Version of the Day
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Classes
Enumeration of Numeric Types

A TypeList based enumeration of numeric types. More...

Classes

struct  phdmesh::NumericEnum< Type >
 Map a numeric scalar Type to an integer value. More...
 
struct  phdmesh::NumericEnum< void >
 Map the integer value associated with a numeric scalar type to a text name or byte size. More...
 
struct  phdmesh::NumericType< Ordinal >
 Inverse map of a numeric scalar type to an integer value. More...
 

Detailed Description

A TypeList based enumeration of numeric types.

Author
H. Carter Edwards hcedw.nosp@m.ar@s.nosp@m.andia.nosp@m..gov
Date
October 2007

A TypeList is used instead of declaring an enum so that the integer values are clearly defined and extension of the list is robust.

An enumeration value for a type is given by: NumericEnum< Type >::value . Thus a switch statement for a numeric type is formed as follows.

switch( my_value ) {
case NumericEnum< int >::value : ... ; break ;
case NumericEnum< float >::value : ... ; break ;
case NumericEnum< double >::value : ... ; break ;
default: ... ;
}