ATLAS Offline Software
Loading...
Searching...
No Matches
DbColumn Class Reference

Description: Definition of the generic column in a (relational) Database. More...

#include <StorageSvc/DbColumn.h>

Inheritance diagram for DbColumn:
Collaboration diagram for DbColumn:

Public Types

enum  Options {
  PRIMARY_KEY = 1 << 0 , NOT_NULL = 1 << 1 , UNIQUE = 1 << 2 , CLUSTERED = 1 << 3 ,
  NONCLUSTERED = 1 << 4
}
enum  Type {
  UNKNOWN = 0 , UCHAR , USHORT , UINT ,
  ULONG , CHAR , SHORT , INT ,
  LONG , BOOL , FLOAT , DOUBLE ,
  STRING , NTCHAR , LONG_STRING , LONG_NTCHAR ,
  OBJECT_REF , CONTAINED_REF , TOKEN , BLOB ,
  ANY , POINTER , LONGLONG , ULONGLONG ,
  NATIVE_TYPES = 1000
}

Public Member Functions

 DbColumn (const DbColumn &)=default
 Default copy constructor.
DbColumn & operator= (const DbColumn &)=default
 DbColumn (const std::string &column_name, int object_type, int object_offset, int object_size, int number_of_elements=1, int opt=0)
 Initializing constructor for fixed size arrays.
 DbColumn (const std::string &nam, const std::string &clazz, int object_type, int object_offset)
 Initializing constructor for composite columns.
virtual ~DbColumn ()
 Standard destructor.
bool isValid () const
 Is it a valid (known) data type ?
const std::string & name () const
 Access to column name.
const std::string & typeName () const
 Access to OS independent type name.
int options () const
 Access to options.
int offset () const
 Offset of column from this pointer.
int size () const
 Size of a single object within the column.
int nElement () const
 Number of elements.
int typeID () const
 Integer type identifier.
const std::string toString () const
 Create string representation of the type information object.
StatusCode fromString (const std::string &string_rep)
 Load type information object from string representation.

Static Public Member Functions

static const std::string typeName (int typ)
 Access type name by type identifier from RTTI.

Private Member Functions

 DbColumn ()
 Cache class information (if available) Do not allow unwanted instantiations by users.

Private Attributes

std::string m_typeName
 OS independent type name.
std::string m_colName
 Column name.
int m_offset
 Offset from object pointer.
int m_nElem
 For fixed size arrays: number of object elements.
int m_opts
 Column options.
int m_size
 Object size.
int m_type
 Storage Type identifier.

Friends

class DbTypeInfo

Detailed Description

Description: Definition of the generic column in a (relational) Database.

Author
M.Frank

Definition at line 20 of file DbColumn.h.

Member Enumeration Documentation

◆ Options

Enumerator
PRIMARY_KEY 
NOT_NULL 
UNIQUE 
CLUSTERED 
NONCLUSTERED 

Definition at line 22 of file DbColumn.h.

22 {PRIMARY_KEY = 1 << 0,
23 NOT_NULL = 1 << 1,
24 UNIQUE = 1 << 2,
25 CLUSTERED = 1 << 3,
26 NONCLUSTERED= 1 << 4
27 };
@ NOT_NULL
Definition DbColumn.h:23
@ CLUSTERED
Definition DbColumn.h:25
@ NONCLUSTERED
Definition DbColumn.h:26
@ PRIMARY_KEY
Definition DbColumn.h:22

◆ Type

Enumerator
UNKNOWN 
UCHAR 
USHORT 
UINT 
ULONG 
CHAR 
SHORT 
INT 
LONG 
BOOL 
FLOAT 
DOUBLE 
STRING 
NTCHAR 
LONG_STRING 
LONG_NTCHAR 
OBJECT_REF 
CONTAINED_REF 
TOKEN 
BLOB 
ANY 
POINTER 
LONGLONG 
ULONGLONG 
NATIVE_TYPES 

Definition at line 29 of file DbColumn.h.

29 {
30 UNKNOWN = 0,
32 CHAR, SHORT, INT, LONG,
37 NATIVE_TYPES = 1000
38 };
@ LONG_NTCHAR
Definition DbColumn.h:34
@ UNKNOWN
Definition DbColumn.h:30
@ LONGLONG
Definition DbColumn.h:36
@ CONTAINED_REF
Definition DbColumn.h:35
@ OBJECT_REF
Definition DbColumn.h:35
@ POINTER
Definition DbColumn.h:36
@ NATIVE_TYPES
Definition DbColumn.h:37
@ LONG_STRING
Definition DbColumn.h:34
@ ULONGLONG
Definition DbColumn.h:36

Constructor & Destructor Documentation

◆ DbColumn() [1/4]

DbColumn::DbColumn ( )
inlineprivate

Cache class information (if available) Do not allow unwanted instantiations by users.

Definition at line 57 of file DbColumn.h.

58 : m_offset(0),
59 m_nElem(0),
60 m_opts(0),
61 m_size(0),
62 m_type(0)
63 {}
int m_offset
Offset from object pointer.
Definition DbColumn.h:46
int m_nElem
For fixed size arrays: number of object elements.
Definition DbColumn.h:48
int m_type
Storage Type identifier.
Definition DbColumn.h:54
int m_opts
Column options.
Definition DbColumn.h:50
int m_size
Object size.
Definition DbColumn.h:52

◆ DbColumn() [2/4]

DbColumn::DbColumn ( const DbColumn & )
default

Default copy constructor.

◆ DbColumn() [3/4]

DbColumn::DbColumn ( const std::string & column_name,
int object_type,
int object_offset,
int object_size,
int number_of_elements = 1,
int opt = 0 )

Initializing constructor for fixed size arrays.

◆ DbColumn() [4/4]

DbColumn::DbColumn ( const std::string & nam,
const std::string & clazz,
int object_type,
int object_offset )

Initializing constructor for composite columns.

◆ ~DbColumn()

virtual DbColumn::~DbColumn ( )
inlinevirtual

Standard destructor.

Definition at line 81 of file DbColumn.h.

81{ }

Member Function Documentation

◆ fromString()

StatusCode DbColumn::fromString ( const std::string & string_rep)

Load type information object from string representation.

◆ isValid()

bool DbColumn::isValid ( ) const
inline

Is it a valid (known) data type ?

Definition at line 83 of file DbColumn.h.

83{ return m_typeName.length()>0;}
std::string m_typeName
OS independent type name.
Definition DbColumn.h:42

◆ name()

const std::string & DbColumn::name ( ) const
inline

Access to column name.

Definition at line 85 of file DbColumn.h.

85{ return m_colName; }
std::string m_colName
Column name.
Definition DbColumn.h:44

◆ nElement()

int DbColumn::nElement ( ) const
inline

Number of elements.

Definition at line 95 of file DbColumn.h.

95{ return m_nElem; }

◆ offset()

int DbColumn::offset ( ) const
inline

Offset of column from this pointer.

Definition at line 91 of file DbColumn.h.

91{ return m_offset; }

◆ operator=()

DbColumn & DbColumn::operator= ( const DbColumn & )
default

◆ options()

int DbColumn::options ( ) const
inline

Access to options.

Definition at line 89 of file DbColumn.h.

89{ return m_opts; }

◆ size()

int DbColumn::size ( ) const
inline

Size of a single object within the column.

Definition at line 93 of file DbColumn.h.

93{ return m_size; }

◆ toString()

const std::string DbColumn::toString ( ) const

Create string representation of the type information object.

◆ typeID()

int DbColumn::typeID ( ) const
inline

Integer type identifier.

Definition at line 97 of file DbColumn.h.

97{ return m_type; }

◆ typeName() [1/2]

const std::string & DbColumn::typeName ( ) const
inline

Access to OS independent type name.

Definition at line 87 of file DbColumn.h.

87{ return m_typeName; }

◆ typeName() [2/2]

const std::string DbColumn::typeName ( int typ)
static

Access type name by type identifier from RTTI.

◆ DbTypeInfo

friend class DbTypeInfo
friend

Definition at line 40 of file DbColumn.h.

Member Data Documentation

◆ m_colName

std::string DbColumn::m_colName
private

Column name.

Definition at line 44 of file DbColumn.h.

◆ m_nElem

int DbColumn::m_nElem
private

For fixed size arrays: number of object elements.

Definition at line 48 of file DbColumn.h.

◆ m_offset

int DbColumn::m_offset
private

Offset from object pointer.

Definition at line 46 of file DbColumn.h.

◆ m_opts

int DbColumn::m_opts
private

Column options.

Definition at line 50 of file DbColumn.h.

◆ m_size

int DbColumn::m_size
private

Object size.

Definition at line 52 of file DbColumn.h.

◆ m_type

int DbColumn::m_type
private

Storage Type identifier.

Definition at line 54 of file DbColumn.h.

◆ m_typeName

std::string DbColumn::m_typeName
private

OS independent type name.

Definition at line 42 of file DbColumn.h.


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