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

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

#include <StorageSvc/DbColumn.h>

Inheritance diagram for pool::DbColumn:
Collaboration diagram for pool::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.
DbColumnoperator= (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.
DbStatus 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
Version
1.0

Definition at line 35 of file DbColumn.h.

Member Enumeration Documentation

◆ Options

Enumerator
PRIMARY_KEY 
NOT_NULL 
UNIQUE 
CLUSTERED 
NONCLUSTERED 

Definition at line 37 of file DbColumn.h.

37 {PRIMARY_KEY = 1 << 0,
38 NOT_NULL = 1 << 1,
39 UNIQUE = 1 << 2,
40 CLUSTERED = 1 << 3,
41 NONCLUSTERED= 1 << 4
42 };

◆ 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 44 of file DbColumn.h.

44 {
45 UNKNOWN = 0,
47 CHAR, SHORT, INT, LONG,
52 NATIVE_TYPES = 1000
53 };

Constructor & Destructor Documentation

◆ DbColumn() [1/4]

pool::DbColumn::DbColumn ( )
inlineprivate

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

Definition at line 72 of file DbColumn.h.

73 : m_offset(0),
74 m_nElem(0),
75 m_opts(0),
76 m_size(0),
77 m_type(0)
78 {}
int m_nElem
For fixed size arrays: number of object elements.
Definition DbColumn.h:63
int m_type
Storage Type identifier.
Definition DbColumn.h:69
int m_offset
Offset from object pointer.
Definition DbColumn.h:61
int m_opts
Column options.
Definition DbColumn.h:65
int m_size
Object size.
Definition DbColumn.h:67

◆ DbColumn() [2/4]

pool::DbColumn::DbColumn ( const DbColumn & )
default

Default copy constructor.

◆ DbColumn() [3/4]

pool::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]

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

Initializing constructor for composite columns.

◆ ~DbColumn()

virtual pool::DbColumn::~DbColumn ( )
inlinevirtual

Standard destructor.

Definition at line 96 of file DbColumn.h.

96{ }

Member Function Documentation

◆ fromString()

DbStatus pool::DbColumn::fromString ( const std::string & string_rep)

Load type information object from string representation.

◆ isValid()

bool pool::DbColumn::isValid ( ) const
inline

Is it a valid (known) data type ?

Definition at line 98 of file DbColumn.h.

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

◆ name()

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

Access to column name.

Definition at line 100 of file DbColumn.h.

100{ return m_colName; }
std::string m_colName
Column name.
Definition DbColumn.h:59

◆ nElement()

int pool::DbColumn::nElement ( ) const
inline

Number of elements.

Definition at line 110 of file DbColumn.h.

110{ return m_nElem; }

◆ offset()

int pool::DbColumn::offset ( ) const
inline

Offset of column from this pointer.

Definition at line 106 of file DbColumn.h.

106{ return m_offset; }

◆ operator=()

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

◆ options()

int pool::DbColumn::options ( ) const
inline

Access to options.

Definition at line 104 of file DbColumn.h.

104{ return m_opts; }

◆ size()

int pool::DbColumn::size ( ) const
inline

Size of a single object within the column.

Definition at line 108 of file DbColumn.h.

108{ return m_size; }

◆ toString()

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

Create string representation of the type information object.

◆ typeID()

int pool::DbColumn::typeID ( ) const
inline

Integer type identifier.

Definition at line 112 of file DbColumn.h.

112{ return m_type; }

◆ typeName() [1/2]

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

Access to OS independent type name.

Definition at line 102 of file DbColumn.h.

102{ return m_typeName; }

◆ typeName() [2/2]

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

Access type name by type identifier from RTTI.

◆ DbTypeInfo

friend class DbTypeInfo
friend

Definition at line 55 of file DbColumn.h.

Member Data Documentation

◆ m_colName

std::string pool::DbColumn::m_colName
private

Column name.

Definition at line 59 of file DbColumn.h.

◆ m_nElem

int pool::DbColumn::m_nElem
private

For fixed size arrays: number of object elements.

Definition at line 63 of file DbColumn.h.

◆ m_offset

int pool::DbColumn::m_offset
private

Offset from object pointer.

Definition at line 61 of file DbColumn.h.

◆ m_opts

int pool::DbColumn::m_opts
private

Column options.

Definition at line 65 of file DbColumn.h.

◆ m_size

int pool::DbColumn::m_size
private

Object size.

Definition at line 67 of file DbColumn.h.

◆ m_type

int pool::DbColumn::m_type
private

Storage Type identifier.

Definition at line 69 of file DbColumn.h.

◆ m_typeName

std::string pool::DbColumn::m_typeName
private

OS independent type name.

Definition at line 57 of file DbColumn.h.


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