Belle II Software development
Property Class Reference

Public Member Functions

 Property (Type type, int length, int offset=0)
 
 Property (const Property &pro)
 
Type getType () const
 
int getLength () const
 
int getOffset () const
 
void setType (Type type)
 
void setLength (int length)
 
int getTypeSize () const
 
const std::string getTypeText () const
 

Private Attributes

Type m_type
 
int m_length
 
int m_offset
 

Detailed Description

Definition at line 36 of file FieldProperty.h.

Constructor & Destructor Documentation

◆ Property() [1/3]

Property ( )
inline

Definition at line 39 of file FieldProperty.h.

39: m_type(), m_length(0), m_offset(0) {}

◆ Property() [2/3]

Property ( Type  type,
int  length,
int  offset = 0 
)
inline

Definition at line 40 of file FieldProperty.h.

41 : m_type(type), m_length(length), m_offset(offset) {}

◆ Property() [3/3]

Property ( const Property pro)
inline

Definition at line 42 of file FieldProperty.h.

43 : m_type(pro.m_type), m_length(pro.m_length), m_offset(pro.m_offset) {}

◆ ~Property()

~Property ( )
inline

Definition at line 44 of file FieldProperty.h.

44{}

Member Function Documentation

◆ getLength()

int getLength ( ) const
inline

Definition at line 48 of file FieldProperty.h.

48{ return m_length; }

◆ getOffset()

int getOffset ( ) const
inline

Definition at line 49 of file FieldProperty.h.

49{ return m_offset; }

◆ getType()

Type getType ( ) const
inline

Definition at line 47 of file FieldProperty.h.

47{ return m_type; }

◆ getTypeSize()

int getTypeSize ( ) const
inline

Definition at line 53 of file FieldProperty.h.

54 {
55 switch (m_type) {
56 case BOOL: return sizeof(bool);
57 case CHAR: return sizeof(char);
58 case SHORT: return sizeof(short);
59 case INT: return sizeof(int);
60 case LONG: return sizeof(long long);
61 case FLOAT: return sizeof(float);
62 case DOUBLE: return sizeof(double);
63 default: break;
64 }
65 return 0;
66 }

◆ getTypeText()

const std::string getTypeText ( ) const
inline

Definition at line 68 of file FieldProperty.h.

69 {
70 switch (m_type) {
71 case BOOL: return "bool";
72 case CHAR: return "char";
73 case SHORT: return "short";
74 case INT: return "int";
75 case LONG: return "long";
76 case FLOAT: return "float";
77 case DOUBLE: return "double";
78 case TEXT: return "text";
79 case OBJECT: return "object";
80 default: break;
81 }
82 return "";
83 }

◆ setLength()

void setLength ( int  length)
inline

Definition at line 51 of file FieldProperty.h.

51{ m_length = length; }

◆ setType()

void setType ( Type  type)
inline

Definition at line 50 of file FieldProperty.h.

50{ m_type = type; }

Member Data Documentation

◆ m_length

int m_length
private

Definition at line 87 of file FieldProperty.h.

◆ m_offset

int m_offset
private

Definition at line 88 of file FieldProperty.h.

◆ m_type

Type m_type
private

Definition at line 86 of file FieldProperty.h.


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