1 #ifndef _Belle2_FieldProperty_hh
2 #define _Belle2_FieldProperty_hh
32 Property(): m_type(), m_length(0), m_offset(0) {}
33 Property(Type type,
int length,
int offset = 0)
34 : m_type(type), m_length(length), m_offset(offset) {}
36 : m_type(pro.m_type), m_length(pro.m_length), m_offset(pro.m_offset) {}
40 Type getType()
const {
return m_type; }
41 int getLength()
const {
return m_length; }
42 int getOffset()
const {
return m_offset; }
43 void setType(Type type) { m_type = type; }
44 void setLength(
int length) { m_length = length; }
46 int getTypeSize()
const
49 case BOOL:
return sizeof(bool);
50 case CHAR:
return sizeof(char);
51 case SHORT:
return sizeof(short);
52 case INT:
return sizeof(int);
53 case LONG:
return sizeof(
long long);
54 case FLOAT:
return sizeof(float);
55 case DOUBLE:
return sizeof(double);
61 const std::string getTypeText()
const
64 case BOOL:
return "bool";
65 case CHAR:
return "char";
66 case SHORT:
return "short";
67 case INT:
return "int";
68 case LONG:
return "long";
69 case FLOAT:
return "float";
70 case DOUBLE:
return "double";
71 case TEXT:
return "text";
72 case OBJECT:
return "object";
85 typedef std::vector<std::string> NameList;
86 typedef std::map<std::string, DBField::Property> PropertyList;