| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DataTypeInfo Class Reference

Small class which allows access to internal type IDs. More...

#include <GaudiKernel/DataTypeInfo.h>

List of all members.


Public Types

 UNKNOWN = 0
 UCHAR
 USHORT
 UINT
 ULONG
 CHAR
 SHORT
 INT
 LONG
 BOOL
 FLOAT
 DOUBLE
 STRING
 NTCHAR
 OBJECT_REF
 CONTAINED_REF
 POINTER
 OBJECT_ADDR
 LONG_STRING
 LONG_NTCHAR
enum  Type {
  UNKNOWN = 0, UCHAR, USHORT, UINT,
  ULONG, CHAR, SHORT, INT,
  LONG, BOOL, FLOAT, DOUBLE,
  STRING, NTCHAR, OBJECT_REF, CONTAINED_REF,
  POINTER, OBJECT_ADDR, LONG_STRING, LONG_NTCHAR
}

Static Public Member Functions

static Type ID (const bool)
 Access to type information: bool.
static Type ID (const char)
 Access to type information: char.
static Type ID (const short)
 Access to type information: short.
static Type ID (const int)
 Access to type information: int.
static Type ID (const long)
 Access to type information: long.
static Type ID (const unsigned char)
 Access to type information: unsigned char.
static Type ID (const unsigned short)
 Access to type information: unsigned short.
static Type ID (const unsigned int)
 Access to type information: unsigned int.
static Type ID (const unsigned long)
 Access to type information: unsigned long.
static Type ID (const float)
 Access to type information: float.
static Type ID (const double)
 Access to type information: float.
static Type ID (const std::string &)
 Access to type information: std::string.
static Type ID (const char *)
 Access to type information: char* (NULL terminated).
static Type ID (const IOpaqueAddress *)
 Access to type information: IOpaqueAddress.
static Type ID (const void *)
 Access to type information: Pointers.
static Type ID (const SmartRef< DataObject > &)
 Access to type information: DataObject.
static Type ID (const SmartRef< ContainedObject > &)
 Access to type information: Contained object.
static Type ID (const std::type_info &typ)
 Access to type information: the reverse way.
static const std::type_info & type (long typ)
 Access to type information: the reverse way.
static long size (long typ)
 Access to type information: the reverse way.
static long size (const std::type_info &typ)
 Access to type information: the reverse way.
static int copy (void *tar, const void *src, long typ, int numObj)
 Copy data.
static std::string name (long typ)
static std::string name (const std::type_info &typ)
static Type idByName (const std::string &typ)
 Access to type information.
static const std::type_info & typeByName (const std::string &typ)
 Access to type information.

Private Member Functions

 DataTypeInfo ()

Detailed Description

Small class which allows access to internal type IDs.

Definition at line 17 of file DataTypeInfo.h.


Member Enumeration Documentation

enum DataTypeInfo::Type

Enumerator:
UNKNOWN 
UCHAR 
USHORT 
UINT 
ULONG 
CHAR 
SHORT 
INT 
LONG 
BOOL 
FLOAT 
DOUBLE 
STRING 
NTCHAR 
OBJECT_REF 
CONTAINED_REF 
POINTER 
OBJECT_ADDR 
LONG_STRING 
LONG_NTCHAR 

Definition at line 23 of file DataTypeInfo.h.

00023              {
00024         UNKNOWN = 0,
00025         UCHAR,        USHORT,        UINT,        ULONG,
00026         CHAR,         SHORT,         INT,         LONG,
00027         BOOL,         FLOAT,         DOUBLE,
00028         STRING,       NTCHAR,
00029         OBJECT_REF, CONTAINED_REF, POINTER, OBJECT_ADDR,
00030         LONG_STRING,  LONG_NTCHAR
00031   };


Constructor & Destructor Documentation

DataTypeInfo::DataTypeInfo (  )  [inline, private]

Definition at line 20 of file DataTypeInfo.h.

00020 {}


Member Function Documentation

static Type DataTypeInfo::ID ( const   bool  )  [inline, static]

Access to type information: bool.

Definition at line 33 of file DataTypeInfo.h.

00033 { return BOOL;          }

static Type DataTypeInfo::ID ( const   char  )  [inline, static]

Access to type information: char.

Definition at line 35 of file DataTypeInfo.h.

00035 { return CHAR;          }

static Type DataTypeInfo::ID ( const   short  )  [inline, static]

Access to type information: short.

Definition at line 37 of file DataTypeInfo.h.

00037 { return SHORT;         }

static Type DataTypeInfo::ID ( const   int  )  [inline, static]

Access to type information: int.

Definition at line 39 of file DataTypeInfo.h.

00039 { return INT;           }

static Type DataTypeInfo::ID ( const   long  )  [inline, static]

Access to type information: long.

Definition at line 41 of file DataTypeInfo.h.

00041 { return LONG;          }

static Type DataTypeInfo::ID ( const unsigned  char  )  [inline, static]

Access to type information: unsigned char.

Definition at line 43 of file DataTypeInfo.h.

00043 { return UCHAR;         }

static Type DataTypeInfo::ID ( const unsigned  short  )  [inline, static]

Access to type information: unsigned short.

Definition at line 45 of file DataTypeInfo.h.

00045 { return USHORT;        }

static Type DataTypeInfo::ID ( const unsigned  int  )  [inline, static]

Access to type information: unsigned int.

Definition at line 47 of file DataTypeInfo.h.

00047 { return UINT;          }

static Type DataTypeInfo::ID ( const unsigned  long  )  [inline, static]

Access to type information: unsigned long.

Definition at line 49 of file DataTypeInfo.h.

00049 { return ULONG;         }

static Type DataTypeInfo::ID ( const   float  )  [inline, static]

Access to type information: float.

Definition at line 51 of file DataTypeInfo.h.

00051 { return FLOAT;         }

static Type DataTypeInfo::ID ( const   double  )  [inline, static]

Access to type information: float.

Definition at line 53 of file DataTypeInfo.h.

00053 { return DOUBLE;        }

static Type DataTypeInfo::ID ( const std::string &   )  [inline, static]

Access to type information: std::string.

Definition at line 55 of file DataTypeInfo.h.

00055 { return STRING;        }

static Type DataTypeInfo::ID ( const char *   )  [inline, static]

Access to type information: char* (NULL terminated).

Definition at line 57 of file DataTypeInfo.h.

00057 { return NTCHAR;        }

static Type DataTypeInfo::ID ( const IOpaqueAddress  )  [inline, static]

Access to type information: IOpaqueAddress.

Definition at line 59 of file DataTypeInfo.h.

00059 { return OBJECT_ADDR;   }

static Type DataTypeInfo::ID ( const void *   )  [inline, static]

Access to type information: Pointers.

Definition at line 61 of file DataTypeInfo.h.

00061 { return POINTER;       }

static Type DataTypeInfo::ID ( const SmartRef< DataObject > &   )  [inline, static]

Access to type information: DataObject.

Definition at line 63 of file DataTypeInfo.h.

00063 { return OBJECT_REF;    }

static Type DataTypeInfo::ID ( const SmartRef< ContainedObject > &   )  [inline, static]

Access to type information: Contained object.

Definition at line 65 of file DataTypeInfo.h.

00065 { return CONTAINED_REF; }

static Type DataTypeInfo::ID ( const std::type_info &  typ  )  [inline, static]

Access to type information: the reverse way.

Definition at line 68 of file DataTypeInfo.h.

00068                                               {
00069     if ( typ == typeid(unsigned char) )
00070       return UCHAR;
00071     else if ( typ == typeid(unsigned short) )
00072       return USHORT;
00073     else if ( typ == typeid(unsigned int) )
00074       return UINT;
00075     else if ( typ == typeid(unsigned long) )
00076       return ULONG;
00077     else if ( typ == typeid(char) )
00078       return CHAR;
00079     else if ( typ == typeid(short) )
00080       return SHORT;
00081     else if ( typ == typeid(int) )
00082       return INT;
00083     else if ( typ == typeid(long) )
00084       return LONG;
00085     else if ( typ == typeid(bool) )
00086       return BOOL;
00087     else if ( typ == typeid(float) )
00088       return FLOAT;
00089     else if ( typ == typeid(double) )
00090       return DOUBLE;
00091     else if ( typ == typeid(std::string) )
00092       return STRING;
00093     else if ( typ == typeid(char*) )
00094       return NTCHAR;
00095     else if ( typ == typeid(SmartRef<DataObject>) )
00096       return OBJECT_REF;
00097     else if ( typ == typeid(SmartRef<ContainedObject>) )
00098       return CONTAINED_REF;
00099     else if ( typ == typeid(IOpaqueAddress*) )
00100       return OBJECT_ADDR;
00101     else if ( typ == typeid(void*) )
00102       return POINTER;
00103     else
00104       return UNKNOWN;
00105   }

static const std::type_info& DataTypeInfo::type ( long  typ  )  [inline, static]

Access to type information: the reverse way.

Definition at line 108 of file DataTypeInfo.h.

00108                                                 {
00109     switch(typ)   {
00110     case UCHAR:
00111       return typeid(unsigned char);
00112     case USHORT:
00113       return typeid(unsigned short);
00114     case UINT:
00115       return typeid(unsigned int);
00116     case ULONG:
00117       return typeid(unsigned long);
00118     case CHAR:
00119       return typeid(char);
00120     case SHORT:
00121       return typeid(short);
00122     case INT:
00123       return typeid(int);
00124     case LONG:
00125       return typeid(long);
00126     case BOOL:
00127       return typeid(bool);
00128     case FLOAT:
00129       return typeid(float);
00130     case DOUBLE:
00131       return typeid(double);
00132     case LONG_STRING:
00133       return typeid(std::string);
00134     case STRING:
00135       return typeid(std::string);
00136     case NTCHAR:
00137       return typeid(char*);
00138     case LONG_NTCHAR:
00139       return typeid(char*);
00140     case OBJECT_REF:
00141       return typeid(SmartRef<DataObject>);
00142     case CONTAINED_REF:
00143       return typeid(SmartRef<ContainedObject>);
00144     case OBJECT_ADDR:
00145       return typeid(IOpaqueAddress*);
00146     case POINTER:
00147     case UNKNOWN:
00148     default:
00149       return typeid(void*);
00150     }
00151   }

static long DataTypeInfo::size ( long  typ  )  [inline, static]

Access to type information: the reverse way.

Definition at line 154 of file DataTypeInfo.h.

00154                                  {
00155     switch(typ)   {
00156     case UCHAR:
00157       return sizeof(unsigned char);
00158     case USHORT:
00159       return sizeof(unsigned short);
00160     case UINT:
00161       return sizeof(unsigned int);
00162     case ULONG:
00163       return sizeof(unsigned long);
00164     case CHAR:
00165       return sizeof(char);
00166     case SHORT:
00167       return sizeof(short);
00168     case INT:
00169       return sizeof(int);
00170     case LONG:
00171       return sizeof(long);
00172     case BOOL:
00173       return sizeof(bool);
00174     case FLOAT:
00175       return sizeof(float);
00176     case DOUBLE:
00177       return sizeof(double);
00178     case STRING:
00179       return sizeof(std::string);
00180     case LONG_STRING:
00181       return sizeof(std::string);
00182     case NTCHAR:
00183       return sizeof(char*);
00184     case LONG_NTCHAR:
00185       return sizeof(char*);
00186     case OBJECT_ADDR:
00187     case POINTER:
00188     case OBJECT_REF:
00189     case CONTAINED_REF:
00190     case UNKNOWN:
00191     default:
00192       return 0;
00193     }
00194   }

static long DataTypeInfo::size ( const std::type_info &  typ  )  [inline, static]

Access to type information: the reverse way.

Definition at line 197 of file DataTypeInfo.h.

00197                                                 {
00198     return size( ID(typ) );
00199   }

static int DataTypeInfo::copy ( void *  tar,
const void *  src,
long  typ,
int  numObj 
) [inline, static]

Copy data.

Definition at line 202 of file DataTypeInfo.h.

00202                                                                         {
00203     switch(typ)   {
00204     case UCHAR:      numObj *= sizeof(unsigned char);       break;
00205     case USHORT:     numObj *= sizeof(unsigned short);      break;
00206     case UINT:       numObj *= sizeof(unsigned int);        break;
00207     case ULONG:      numObj *= sizeof(unsigned long);       break;
00208     case CHAR:       numObj *= sizeof(char);                break;
00209     case SHORT:      numObj *= sizeof(short);               break;
00210     case INT:        numObj *= sizeof(int);                 break;
00211     case LONG:       numObj *= sizeof(long);                break;
00212     case BOOL:       numObj *= sizeof(bool);                break;
00213     case FLOAT:      numObj *= sizeof(float);               break;
00214     case DOUBLE:     numObj *= sizeof(double);              break;
00215     case UNKNOWN:
00216     default:         numObj *= 0;                           break;
00217     }
00218     memcpy(tar, src, numObj);
00219     return numObj;
00220   }

static std::string DataTypeInfo::name ( long  typ  )  [static]

static std::string DataTypeInfo::name ( const std::type_info &  typ  )  [static]

static Type DataTypeInfo::idByName ( const std::string &  typ  )  [static]

Access to type information.

static const std::type_info& DataTypeInfo::typeByName ( const std::string &  typ  )  [static]

Access to type information.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:06 2011 for GaudiKernel by doxygen 1.4.7