| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Static Public Member Functions | Private Member Functions | List of all members
DataTypeInfo Class Reference

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

`#include <GaudiKernel/DataTypeInfo.h>`

## Public Types
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, LONGLONG, ULONGLONG }

## Static Public Member Functions
static Type | ID (const bool)
| Access to type information: bool. More...
static Type | ID (const char)
| Access to type information: char. More...
static Type | ID (const short)
| Access to type information: short. More...
static Type | ID (const int)
| Access to type information: int. More...
static Type | ID (const long)
| Access to type information: long. More...
static Type | ID (const long long)
| Access to type information: long long. More...
static Type | ID (const unsigned char)
| Access to type information: unsigned char. More...
static Type | ID (const unsigned short)
| Access to type information: unsigned short. More...
static Type | ID (const unsigned int)
| Access to type information: unsigned int. More...
static Type | ID (const unsigned long)
| Access to type information: unsigned long. More...
static Type | ID (const unsigned long long)
| Access to type information: unsigned long long. More...
static Type | ID (const float)
| Access to type information: float. More...
static Type | ID (const double)
| Access to type information: float. More...
static Type | ID (const std::string &)
| Access to type information: std::string. More...
static Type | ID (const char *)
| Access to type information: char* (NULL terminated) More...
static Type | ID (const IOpaqueAddress *)
| Access to type information: IOpaqueAddress. More...
static Type | ID (const void *)
| Access to type information: Pointers. More...
static Type | ID (const SmartRef< DataObject > &)
| Access to type information: DataObject. More...
static Type | ID (const SmartRef< ContainedObject > &)
| Access to type information: Contained object. More...
static Type | ID (const std::type_info &typ)
| Access to type information: the reverse way. More...
static const std::type_info & | type (long typ)
| Access to type information: the reverse way. More...
static long | size (long typ)
| Access to type information: the reverse way. More...
static long | size (const std::type_info &typ)
| Access to type information: the reverse way. More...
static int | copy (void *tar, const void *src, long typ, int numObj)
| Copy data. More...
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. More...
static const std::type_info & | typeByName (const std::string &typ)
| Access to type information. More...

## Private Member Functions
| DataTypeInfo ()

## Detailed Description

Small class which allows access to internal type IDs.

Definition at line 16 of file DataTypeInfo.h.

## Member Enumeration Documentation

## ◆ Type

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 |
LONGLONG |
ULONGLONG |

Definition at line 23 of file DataTypeInfo.h.

23 {
24 UNKNOWN = 0,
25 UCHAR,
26 USHORT,
27 UINT,
28 ULONG,
29 CHAR,
30 SHORT,
31 INT,
32 LONG,
33 BOOL,
34 FLOAT,
35 DOUBLE,
36 STRING,
37 NTCHAR,
38 OBJECT_REF,
39 CONTAINED_REF,
40 POINTER,
41 OBJECT_ADDR,
42 LONG_STRING,
43 LONG_NTCHAR,
44 LONGLONG,
45 ULONGLONG
46 };
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45
DataTypeInfo::LONG_NTCHAR
Definition: DataTypeInfo.h:43
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::LONG_STRING
Definition: DataTypeInfo.h:42
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34

## Constructor & Destructor Documentation

## ◆ DataTypeInfo()

DataTypeInfo::DataTypeInfo | ( |  | ) |
| inline private

Definition at line 19 of file DataTypeInfo.h.

19 {}

## Member Function Documentation

## ◆ copy()

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

Copy data.

Definition at line 231 of file DataTypeInfo.h.

231 {
232 switch ( typ ) {
233 case UCHAR:
234 numObj *= sizeof( unsigned char );
235 break;
236 case USHORT:
237 numObj *= sizeof( unsigned short );
238 break;
239 case UINT:
240 numObj *= sizeof( unsigned int );
241 break;
242 case ULONG:
243 numObj *= sizeof( unsigned long );
244 break;
245 case ULONGLONG:
246 numObj *= sizeof( unsigned long long );
247 break;
248 case CHAR:
249 numObj *= sizeof( char );
250 break;
251 case SHORT:
252 numObj *= sizeof( short );
253 break;
254 case INT:
255 numObj *= sizeof( int );
256 break;
257 case LONG:
258 numObj *= sizeof( long );
259 break;
260 case LONGLONG:
261 numObj *= sizeof( long long );
262 break;
263 case BOOL:
264 numObj *= sizeof( bool );
265 break;
266 case FLOAT:
267 numObj *= sizeof( float );
268 break;
269 case DOUBLE:
270 numObj *= sizeof( double );
271 break;
272 case UNKNOWN:
273 default:
274 numObj *= 0;
275 break;
276 }
277 memcpy( tar, src, numObj );
278 return numObj;
279 }
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
std::memcpy
T memcpy(T... args)
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34

## ◆ ID() [1/20]

static Type DataTypeInfo::ID | ( | const bool |  | ) |
| inline static

Access to type information: bool.

Definition at line 48 of file DataTypeInfo.h.

48 { return BOOL; }
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33

## ◆ ID() [2/20]

static Type DataTypeInfo::ID | ( | const char |  | ) |
| inline static

Access to type information: char.

Definition at line 50 of file DataTypeInfo.h.

50 { return CHAR; }
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29

## ◆ ID() [3/20]

static Type DataTypeInfo::ID | ( | const short |  | ) |
| inline static

Access to type information: short.

Definition at line 52 of file DataTypeInfo.h.

52 { return SHORT; }
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30

## ◆ ID() [4/20]

static Type DataTypeInfo::ID | ( | const int |  | ) |
| inline static

Access to type information: int.

Definition at line 54 of file DataTypeInfo.h.

54 { return INT; }
DataTypeInfo::INT
Definition: DataTypeInfo.h:31

## ◆ ID() [5/20]

static Type DataTypeInfo::ID | ( | const long |  | ) |
| inline static

Access to type information: long.

Definition at line 56 of file DataTypeInfo.h.

56 { return LONG; }
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32

## ◆ ID() [6/20]

static Type DataTypeInfo::ID | ( | const long long |  | ) |
| inline static

Access to type information: long long.

Definition at line 58 of file DataTypeInfo.h.

58 { return LONGLONG; }
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44

## ◆ ID() [7/20]

static Type DataTypeInfo::ID | ( | const unsigned char |  | ) |
| inline static

Access to type information: unsigned char.

Definition at line 60 of file DataTypeInfo.h.

60 { return UCHAR; }
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25

## ◆ ID() [8/20]

static Type DataTypeInfo::ID | ( | const unsigned short |  | ) |
| inline static

Access to type information: unsigned short.

Definition at line 62 of file DataTypeInfo.h.

62 { return USHORT; }
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26

## ◆ ID() [9/20]

static Type DataTypeInfo::ID | ( | const unsigned int |  | ) |
| inline static

Access to type information: unsigned int.

Definition at line 64 of file DataTypeInfo.h.

64 { return UINT; }
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27

## ◆ ID() [10/20]

static Type DataTypeInfo::ID | ( | const unsigned long |  | ) |
| inline static

Access to type information: unsigned long.

Definition at line 66 of file DataTypeInfo.h.

66 { return ULONG; }
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28

## ◆ ID() [11/20]

static Type DataTypeInfo::ID | ( | const unsigned long long |  | ) |
| inline static

Access to type information: unsigned long long.

Definition at line 68 of file DataTypeInfo.h.

68 { return ULONGLONG; }
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45

## ◆ ID() [12/20]

static Type DataTypeInfo::ID | ( | const float |  | ) |
| inline static

Access to type information: float.

Definition at line 70 of file DataTypeInfo.h.

70 { return FLOAT; }
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34

## ◆ ID() [13/20]

static Type DataTypeInfo::ID | ( | const double |  | ) |
| inline static

Access to type information: float.

Definition at line 72 of file DataTypeInfo.h.

72 { return DOUBLE; }
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35

## ◆ ID() [14/20]

static Type DataTypeInfo::ID | ( | const std::string & |  | ) |
| inline static

Access to type information: std::string.

Definition at line 74 of file DataTypeInfo.h.

74 { return STRING; }
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36

## ◆ ID() [15/20]

static Type DataTypeInfo::ID | ( | const char * |  | ) |
| inline static

Access to type information: char* (NULL terminated)

Definition at line 76 of file DataTypeInfo.h.

76 { return NTCHAR; }
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37

## ◆ ID() [16/20]

static Type DataTypeInfo::ID | ( | const IOpaqueAddress * |  | ) |
| inline static

Access to type information: IOpaqueAddress.

Definition at line 78 of file DataTypeInfo.h.

78 { return OBJECT_ADDR; }
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41

## ◆ ID() [17/20]

static Type DataTypeInfo::ID | ( | const void * |  | ) |
| inline static

Access to type information: Pointers.

Definition at line 80 of file DataTypeInfo.h.

80 { return POINTER; }
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40

## ◆ ID() [18/20]

static Type DataTypeInfo::ID | ( | const SmartRef< DataObject > & |  | ) |
| inline static

Access to type information: DataObject.

Definition at line 82 of file DataTypeInfo.h.

82 { return OBJECT_REF; }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38

## ◆ ID() [19/20]

static Type DataTypeInfo::ID | ( | const SmartRef< ContainedObject > & |  | ) |
| inline static

Access to type information: Contained object.

Definition at line 84 of file DataTypeInfo.h.

84 { return CONTAINED_REF; }
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39

## ◆ ID() [20/20]

static Type DataTypeInfo::ID | ( | const std::type_info & | typ | ) |
| inline static

Access to type information: the reverse way.

Definition at line 87 of file DataTypeInfo.h.

87 {
88 if ( typ == typeid( unsigned char ) )
89 return UCHAR;
90 else if ( typ == typeid( unsigned short ) )
91 return USHORT;
92 else if ( typ == typeid( unsigned int ) )
93 return UINT;
94 else if ( typ == typeid( unsigned long ) )
95 return ULONG;
96 else if ( typ == typeid( unsigned long long ) )
97 return ULONGLONG;
98 else if ( typ == typeid( char ) )
99 return CHAR;
100 else if ( typ == typeid( short ) )
101 return SHORT;
102 else if ( typ == typeid( int ) )
103 return INT;
104 else if ( typ == typeid( long ) )
105 return LONG;
106 else if ( typ == typeid( long long ) )
107 return LONGLONG;
108 else if ( typ == typeid( bool ) )
109 return BOOL;
110 else if ( typ == typeid( float ) )
111 return FLOAT;
112 else if ( typ == typeid( double ) )
113 return DOUBLE;
114 else if ( typ == typeid( std::string ) )
115 return STRING;
116 else if ( typ == typeid( char* ) )
117 return NTCHAR;
118 else if ( typ == typeid( SmartRef<DataObject> ) )
119 return OBJECT_REF;
120 else if ( typ == typeid( SmartRef<ContainedObject> ) )
121 return CONTAINED_REF;
122 else if ( typ == typeid( IOpaqueAddress* ) )
123 return OBJECT_ADDR;
124 else if ( typ == typeid( void* ) )
125 return POINTER;
126 else
127 return UNKNOWN;
128 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
SmartRef< DataObject >
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
std::string
STL class.
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23

## ◆ idByName()

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

Access to type information.

Definition at line 24 of file DataTypeInfo.cpp.

24 {
25 if ( typ == "unsigned char" || typ == "const unsigned char" )
26 return UCHAR;
27 else if ( typ == "unsigned short" || typ == "const unsigned short" )
28 return USHORT;
29 else if ( typ == "unsigned int" || typ == "const unsigned int" )
30 return UINT;
31 else if ( typ == "unsigned long" || typ == "const unsigned long" )
32 return ULONG;
33 else if ( typ == "char" || typ == "const char" )
34 return CHAR;
35 else if ( typ == "short" || typ == "const short" )
36 return SHORT;
37 else if ( typ == "int" || typ == "const int" )
38 return INT;
39 else if ( typ == "long" || typ == "const long" )
40 return LONG;
41 else if ( typ == "bool" || typ == "const bool" )
42 return BOOL;
43 else if ( typ == "float" || typ == "const float" )
44 return FLOAT;
45 else if ( typ == "double" || typ == "const double" )
46 return DOUBLE;
47 else if ( typ == "std::string" || typ == "const std::string" )
48 return STRING;
49 else if ( typ == "char*" || typ == "const char*" )
50 return NTCHAR;
51 else if ( typ == "IOpaqueAddress*" || typ == "const IOpaqueAddress*" )
52 return OBJECT_ADDR;
53 else if ( typ == "SmartRef<DataObject>" || typ == "const SmartRef<DataObject>" )
54 return OBJECT_REF;
55 else if ( typ == "SmartRef<ContainedObject>" || typ == "const SmartRef<ContainedObject>" )
56 return CONTAINED_REF;
57 else if ( typ == "void*" || typ == "const void*" )
58 return POINTER;
59 else
60 return UNKNOWN;
61 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34

## ◆ name() [1/2]

std::string DataTypeInfo::name | ( | long | typ | ) |
| static

Definition at line 102 of file DataTypeInfo.cpp.

102 {
103 switch ( typ ) {
104 case UCHAR:
105 return System::typeinfoName( typeid( unsigned char ) );
106 case USHORT:
107 return System::typeinfoName( typeid( unsigned short ) );
108 case UINT:
109 return System::typeinfoName( typeid( unsigned int ) );
110 case ULONG:
111 return System::typeinfoName( typeid( unsigned long ) );
112 case CHAR:
113 return System::typeinfoName( typeid( char ) );
114 case SHORT:
115 return System::typeinfoName( typeid( short ) );
116 case INT:
117 return System::typeinfoName( typeid( int ) );
118 case LONG:
119 return System::typeinfoName( typeid( long ) );
120 case BOOL:
121 return System::typeinfoName( typeid( bool ) );
122 case FLOAT:
123 return System::typeinfoName( typeid( float ) );
124 case DOUBLE:
125 return System::typeinfoName( typeid( double ) );
126 case STRING:
127 return System::typeinfoName( typeid( std::string ) );
128 case LONG_STRING:
129 return System::typeinfoName( typeid( std::string ) );
130 case NTCHAR:
131 return System::typeinfoName( typeid( char* ) );
132 case LONG_NTCHAR:
133 return System::typeinfoName( typeid( char* ) );
134 case OBJECT_ADDR:
135 return System::typeinfoName( typeid( IOpaqueAddress* ) );
136 case OBJECT_REF:
137 return System::typeinfoName( typeid( SmartRef<DataObject> ) );
138 case CONTAINED_REF:
139 return System::typeinfoName( typeid( SmartRef<ContainedObject> ) );
140 case POINTER:
141 return System::typeinfoName( typeid( void* ) );
142 case UNKNOWN:
143 default:
144 return "";
145 }
146 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
SmartRef< DataObject >
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
std::string
STL class.
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::LONG_NTCHAR
Definition: DataTypeInfo.h:43
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::LONG_STRING
Definition: DataTypeInfo.h:42
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23

## ◆ name() [2/2]

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

Definition at line 149 of file DataTypeInfo.cpp.

149 {
150 if ( typ == typeid( unsigned char ) )
151 return DataTypeInfo::name( UCHAR );
152 else if ( typ == typeid( unsigned short ) )
153 return DataTypeInfo::name( USHORT );
154 else if ( typ == typeid( unsigned int ) )
155 return DataTypeInfo::name( UINT );
156 else if ( typ == typeid( unsigned long ) )
157 return DataTypeInfo::name( ULONG );
158 else if ( typ == typeid( char ) )
159 return DataTypeInfo::name( CHAR );
160 else if ( typ == typeid( short ) )
161 return DataTypeInfo::name( SHORT );
162 else if ( typ == typeid( int ) )
163 return DataTypeInfo::name( INT );
164 else if ( typ == typeid( long ) )
165 return DataTypeInfo::name( LONG );
166 else if ( typ == typeid( bool ) )
167 return DataTypeInfo::name( BOOL );
168 else if ( typ == typeid( float ) )
169 return DataTypeInfo::name( FLOAT );
170 else if ( typ == typeid( double ) )
171 return DataTypeInfo::name( DOUBLE );
172 else if ( typ == typeid( std::string ) )
173 return DataTypeInfo::name( STRING );
174 else if ( typ == typeid( char* ) )
175 return DataTypeInfo::name( NTCHAR );
176 else if ( typ == typeid( IOpaqueAddress* ) )
177 return DataTypeInfo::name( OBJECT_ADDR );
178 else if ( typ == typeid( SmartRef<DataObject> ) )
179 return DataTypeInfo::name( OBJECT_REF );
180 else if ( typ == typeid( SmartRef<ContainedObject> ) )
181 return DataTypeInfo::name( CONTAINED_REF );
182 else if ( typ == typeid( void* ) )
183 return DataTypeInfo::name( POINTER );
184 else
185 return DataTypeInfo::name( UNKNOWN );
186 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
SmartRef< DataObject >
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
std::string
STL class.
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataTypeInfo::name
static std::string name(long typ)
Definition: DataTypeInfo.cpp:102

## ◆ size() [1/2]

static long DataTypeInfo::size | ( | long | typ | ) |
| inline static

Access to type information: the reverse way.

Definition at line 181 of file DataTypeInfo.h.

181 {
182 switch ( typ ) {
183 case UCHAR:
184 return sizeof( unsigned char );
185 case USHORT:
186 return sizeof( unsigned short );
187 case UINT:
188 return sizeof( unsigned int );
189 case ULONG:
190 return sizeof( unsigned long );
191 case ULONGLONG:
192 return sizeof( unsigned long long );
193 case CHAR:
194 return sizeof( char );
195 case SHORT:
196 return sizeof( short );
197 case INT:
198 return sizeof( int );
199 case LONG:
200 return sizeof( long );
201 case LONGLONG:
202 return sizeof( long long );
203 case BOOL:
204 return sizeof( bool );
205 case FLOAT:
206 return sizeof( float );
207 case DOUBLE:
208 return sizeof( double );
209 case STRING:
210 return sizeof( std::string );
211 case LONG_STRING:
212 return sizeof( std::string );
213 case NTCHAR:
214 return sizeof( char* );
215 case LONG_NTCHAR:
216 return sizeof( char* );
217 case OBJECT_ADDR:
218 case POINTER:
219 case OBJECT_REF:
220 case CONTAINED_REF:
221 case UNKNOWN:
222 default:
223 return 0;
224 }
225 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
std::string
STL class.
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45
DataTypeInfo::LONG_NTCHAR
Definition: DataTypeInfo.h:43
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::LONG_STRING
Definition: DataTypeInfo.h:42
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34

## ◆ size() [2/2]

static long DataTypeInfo::size | ( | const std::type_info & | typ | ) |
| inline static

Access to type information: the reverse way.

Definition at line 228 of file DataTypeInfo.h.

228 { return size( ID( typ ) ); }
DataTypeInfo::ID
static Type ID(const bool)
Access to type information: bool.
Definition: DataTypeInfo.h:48
DataTypeInfo::size
static long size(long typ)
Access to type information: the reverse way.
Definition: DataTypeInfo.h:181

## ◆ type()

static const std::type_info& DataTypeInfo::type | ( | long | typ | ) |
| inline static

Access to type information: the reverse way.

Definition at line 131 of file DataTypeInfo.h.

131 {
132 switch ( typ ) {
133 case UCHAR:
134 return typeid( unsigned char );
135 case USHORT:
136 return typeid( unsigned short );
137 case UINT:
138 return typeid( unsigned int );
139 case ULONG:
140 return typeid( unsigned long );
141 case ULONGLONG:
142 return typeid( unsigned long long );
143 case CHAR:
144 return typeid( char );
145 case SHORT:
146 return typeid( short );
147 case INT:
148 return typeid( int );
149 case LONG:
150 return typeid( long );
151 case LONGLONG:
152 return typeid( long long );
153 case BOOL:
154 return typeid( bool );
155 case FLOAT:
156 return typeid( float );
157 case DOUBLE:
158 return typeid( double );
159 case LONG_STRING:
160 return typeid( std::string );
161 case STRING:
162 return typeid( std::string );
163 case NTCHAR:
164 return typeid( char* );
165 case LONG_NTCHAR:
166 return typeid( char* );
167 case OBJECT_REF:
168 return typeid( SmartRef<DataObject> );
169 case CONTAINED_REF:
170 return typeid( SmartRef<ContainedObject> );
171 case OBJECT_ADDR:
172 return typeid( IOpaqueAddress* );
173 case POINTER:
174 case UNKNOWN:
175 default:
176 return typeid( void* );
177 }
178 }
DataTypeInfo::OBJECT_REF
Definition: DataTypeInfo.h:38
DataTypeInfo::POINTER
Definition: DataTypeInfo.h:40
DataTypeInfo::INT
Definition: DataTypeInfo.h:31
DataTypeInfo::CHAR
Definition: DataTypeInfo.h:29
SmartRef< DataObject >
DataTypeInfo::STRING
Definition: DataTypeInfo.h:36
DataTypeInfo::SHORT
Definition: DataTypeInfo.h:30
DataTypeInfo::NTCHAR
Definition: DataTypeInfo.h:37
std::string
STL class.
DataTypeInfo::UINT
Definition: DataTypeInfo.h:27
DataTypeInfo::USHORT
Definition: DataTypeInfo.h:26
DataTypeInfo::BOOL
Definition: DataTypeInfo.h:33
DataTypeInfo::UCHAR
Definition: DataTypeInfo.h:25
DataTypeInfo::ULONG
Definition: DataTypeInfo.h:28
DataTypeInfo::LONG
Definition: DataTypeInfo.h:32
DataTypeInfo::DOUBLE
Definition: DataTypeInfo.h:35
DataTypeInfo::UNKNOWN
Definition: DataTypeInfo.h:24
DataTypeInfo::ULONGLONG
Definition: DataTypeInfo.h:45
DataTypeInfo::LONG_NTCHAR
Definition: DataTypeInfo.h:43
DataTypeInfo::CONTAINED_REF
Definition: DataTypeInfo.h:39
DataTypeInfo::LONGLONG
Definition: DataTypeInfo.h:44
DataTypeInfo::OBJECT_ADDR
Definition: DataTypeInfo.h:41
DataTypeInfo::LONG_STRING
Definition: DataTypeInfo.h:42
DataTypeInfo::FLOAT
Definition: DataTypeInfo.h:34
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23

## ◆ typeByName()

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

Access to type information.

Definition at line 64 of file DataTypeInfo.cpp.

64 {
65 if ( typ == "unsigned char" || typ == "const unsigned char" )
66 return typeid( unsigned char );
67 else if ( typ == "unsigned short" || typ == "const unsigned short" )
68 return typeid( unsigned short );
69 else if ( typ == "unsigned int" || typ == "const unsigned int" )
70 return typeid( unsigned int );
71 else if ( typ == "unsigned long" || typ == "const unsigned long" )
72 return typeid( unsigned long );
73 else if ( typ == "char" || typ == "const char" )
74 return typeid( char );
75 else if ( typ == "short" || typ == "const short" )
76 return typeid( short );
77 else if ( typ == "int" || typ == "const int" )
78 return typeid( int );
79 else if ( typ == "long" || typ == "const long" )
80 return typeid( long );
81 else if ( typ == "bool" || typ == "const bool" )
82 return typeid( bool );
83 else if ( typ == "float" || typ == "const float" )
84 return typeid( float );
85 else if ( typ == "double" || typ == "const double" )
86 return typeid( double );
87 else if ( typ == "std::string" || typ == "const std::string" )
88 return typeid( std::string );
89 else if ( typ == "char*" || typ == "const char*" )
90 return typeid( char* );
91 else if ( typ == "IOpaqueAddress*" || typ == "const IOpaqueAddress*" )
92 return typeid( IOpaqueAddress );
93 else if ( typ == "SmartRef<DataObject>" || typ == "const SmartRef<DataObject>" )
94 return typeid( DataObject* );
95 else if ( typ == "SmartRef<ContainedObject>" || typ == "const SmartRef<ContainedObject>" )
96 return typeid( SmartRef<ContainedObject> );
97 else
98 return typeid( void* );
99 }
SmartRef< ContainedObject >
std::string
STL class.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30

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

- GaudiKernel/GaudiKernel/DataTypeInfo.h
- GaudiKernel/src/Lib/DataTypeInfo.cpp