1 #ifndef GAUDIKERNEL_DATATYPES_H
2 #define GAUDIKERNEL_DATATYPES_H
6 #include "GaudiKernel/SmartRef.h"
24 UCHAR, USHORT, UINT, ULONG,
25 CHAR, SHORT, INT, LONG,
28 OBJECT_REF, CONTAINED_REF, POINTER, OBJECT_ADDR,
29 LONG_STRING, LONG_NTCHAR, LONGLONG, ULONGLONG
32 static Type ID(
const bool) {
return BOOL; }
34 static Type ID(
const char) {
return CHAR; }
36 static Type ID(
const short) {
return SHORT; }
38 static Type ID(
const int) {
return INT; }
40 static Type ID(
const long) {
return LONG; }
42 static Type ID(
const long long) {
return LONGLONG; }
44 static Type ID(
const unsigned char) {
return UCHAR; }
46 static Type ID(
const unsigned short) {
return USHORT; }
48 static Type ID(
const unsigned int) {
return UINT; }
50 static Type ID(
const unsigned long) {
return ULONG; }
52 static Type ID(
const unsigned long long) {
return ULONGLONG; }
54 static Type ID(
const float) {
return FLOAT; }
56 static Type ID(
const double) {
return DOUBLE; }
58 static Type ID(
const std::string&) {
return STRING; }
60 static Type ID(
const char*) {
return NTCHAR; }
64 static Type ID(
const void*) {
return POINTER; }
71 static Type ID(
const std::type_info& typ ) {
72 if ( typ ==
typeid(
unsigned char) )
74 else if ( typ ==
typeid(
unsigned short) )
76 else if ( typ ==
typeid(
unsigned int) )
78 else if ( typ ==
typeid(
unsigned long) )
80 else if ( typ ==
typeid(
unsigned long long) )
82 else if ( typ ==
typeid(
char) )
84 else if ( typ ==
typeid(
short) )
86 else if ( typ ==
typeid(
int) )
88 else if ( typ ==
typeid(
long) )
90 else if ( typ ==
typeid(
long long) )
92 else if ( typ ==
typeid(
bool) )
94 else if ( typ ==
typeid(
float) )
96 else if ( typ ==
typeid(
double) )
98 else if ( typ ==
typeid(std::string) )
100 else if ( typ ==
typeid(
char*) )
105 return CONTAINED_REF;
108 else if ( typ ==
typeid(
void*) )
115 static const std::type_info&
type(
long typ ) {
118 return typeid(
unsigned char);
120 return typeid(
unsigned short);
122 return typeid(
unsigned int);
124 return typeid(
unsigned long);
126 return typeid(
unsigned long long);
130 return typeid(short);
136 return typeid(
long long);
140 return typeid(float);
142 return typeid(double);
144 return typeid(std::string);
146 return typeid(std::string);
148 return typeid(
char*);
150 return typeid(
char*);
160 return typeid(
void*);
165 static long size(
long typ ) {
168 return sizeof(
unsigned char);
170 return sizeof(
unsigned short);
172 return sizeof(
unsigned int);
174 return sizeof(
unsigned long);
176 return sizeof(
unsigned long long);
180 return sizeof(short);
186 return sizeof(
long long);
190 return sizeof(float);
192 return sizeof(double);
194 return sizeof(std::string);
196 return sizeof(std::string);
198 return sizeof(
char*);
200 return sizeof(
char*);
212 static long size(
const std::type_info& typ ) {
213 return size( ID(typ) );
217 static int copy(
void* tar,
const void* src,
long typ,
int numObj ) {
219 case UCHAR: numObj *=
sizeof(
unsigned char);
break;
220 case USHORT: numObj *=
sizeof(
unsigned short);
break;
221 case UINT: numObj *=
sizeof(
unsigned int);
break;
222 case ULONG: numObj *=
sizeof(
unsigned long);
break;
223 case ULONGLONG: numObj *=
sizeof(
unsigned long long);
break;
224 case CHAR: numObj *=
sizeof(char);
break;
225 case SHORT: numObj *=
sizeof(short);
break;
226 case INT: numObj *=
sizeof(int);
break;
227 case LONG: numObj *=
sizeof(long);
break;
228 case LONGLONG: numObj *=
sizeof(
long long);
break;
229 case BOOL: numObj *=
sizeof(bool);
break;
230 case FLOAT: numObj *=
sizeof(float);
break;
231 case DOUBLE: numObj *=
sizeof(double);
break;
233 default: numObj *= 0;
break;
235 memcpy(tar, src, numObj);
240 static std::string
name(
long typ);
242 static std::string
name(
const std::type_info& typ);
244 static Type idByName(
const std::string& typ );
246 static const std::type_info& typeByName(
const std::string& typ );
248 #endif // GAUDIKERNEL_DATATYPES_H
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Type
the list of available types for ntuples
Small class which allows access to internal type IDs.