ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
pool::DbColumn Class Reference

#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. More...
 
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. More...
 
 DbColumn (const std::string &nam, const std::string &clazz, int object_type, int object_offset)
 Initializing constructor for composite columns. More...
 
virtual ~DbColumn ()
 Standard destructor. More...
 
bool isValid () const
 Is it a valid (known) data type ? More...
 
const std::string & name () const
 Access to column name. More...
 
const std::string & typeName () const
 Access to OS independent type name. More...
 
int options () const
 Access to options. More...
 
int offset () const
 Offset of column from this pointer. More...
 
int size () const
 Size of a single object within the column. More...
 
int nElement () const
 Number of elements. More...
 
int typeID () const
 Integer type identifier. More...
 
const std::string toString () const
 Create string representation of the type information object. More...
 
DbStatus fromString (const std::string &string_rep)
 Load type information object from string representation. More...
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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,
48  BOOL, FLOAT, DOUBLE,
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  {}

◆ 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;}

◆ 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; }

◆ 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]

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

Access type name by type identifier from RTTI.

Friends And Related Function Documentation

◆ 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:
pool::DbColumn::UCHAR
@ UCHAR
Definition: DbColumn.h:46
pool::DbColumn::m_typeName
std::string m_typeName
OS independent type name.
Definition: DbColumn.h:57
pool::DbColumn::m_type
int m_type
Storage Type identifier.
Definition: DbColumn.h:69
pool::DbColumn::BLOB
@ BLOB
Definition: DbColumn.h:50
pool::DbColumn::SHORT
@ SHORT
Definition: DbColumn.h:47
pool::DbColumn::UINT
@ UINT
Definition: DbColumn.h:46
pool::DbColumn::LONG
@ LONG
Definition: DbColumn.h:47
pool::DbColumn::CONTAINED_REF
@ CONTAINED_REF
Definition: DbColumn.h:50
pool::DbColumn::UNIQUE
@ UNIQUE
Definition: DbColumn.h:39
pool::DbColumn::ANY
@ ANY
Definition: DbColumn.h:51
pool::DbColumn::LONG_STRING
@ LONG_STRING
Definition: DbColumn.h:49
pool::DbColumn::m_colName
std::string m_colName
Column name.
Definition: DbColumn.h:59
pool::DbColumn::CHAR
@ CHAR
Definition: DbColumn.h:47
pool::DbColumn::NTCHAR
@ NTCHAR
Definition: DbColumn.h:49
pool::DbColumn::INT
@ INT
Definition: DbColumn.h:47
pool::DbColumn::m_size
int m_size
Object size.
Definition: DbColumn.h:67
pool::DbColumn::USHORT
@ USHORT
Definition: DbColumn.h:46
pool::DbColumn::NATIVE_TYPES
@ NATIVE_TYPES
Definition: DbColumn.h:52
pool::DbColumn::NONCLUSTERED
@ NONCLUSTERED
Definition: DbColumn.h:41
pool::DbColumn::TOKEN
@ TOKEN
Definition: DbColumn.h:50
pool::DbColumn::m_nElem
int m_nElem
For fixed size arrays: number of object elements.
Definition: DbColumn.h:63
pool::DbColumn::PRIMARY_KEY
@ PRIMARY_KEY
Definition: DbColumn.h:37
pool::DbColumn::FLOAT
@ FLOAT
Definition: DbColumn.h:48
pool::DbColumn::LONGLONG
@ LONGLONG
Definition: DbColumn.h:51
pool::DbColumn::LONG_NTCHAR
@ LONG_NTCHAR
Definition: DbColumn.h:49
pool::DbColumn::m_opts
int m_opts
Column options.
Definition: DbColumn.h:65
pool::DbColumn::ULONG
@ ULONG
Definition: DbColumn.h:46
pool::DbColumn::DOUBLE
@ DOUBLE
Definition: DbColumn.h:48
pool::DbColumn::NOT_NULL
@ NOT_NULL
Definition: DbColumn.h:38
pool::DbColumn::POINTER
@ POINTER
Definition: DbColumn.h:51
pool::DbColumn::STRING
@ STRING
Definition: DbColumn.h:49
pool::DbColumn::ULONGLONG
@ ULONGLONG
Definition: DbColumn.h:51
pool::DbColumn::CLUSTERED
@ CLUSTERED
Definition: DbColumn.h:40
pool::DbColumn::OBJECT_REF
@ OBJECT_REF
Definition: DbColumn.h:50
pool::DbColumn::UNKNOWN
@ UNKNOWN
Definition: DbColumn.h:45
pool::DbColumn::BOOL
@ BOOL
Definition: DbColumn.h:48
pool::DbColumn::m_offset
int m_offset
Offset from object pointer.
Definition: DbColumn.h:61