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

#include <StorageSvc/DbType.h>

Collaboration diagram for pool::DbType:

Public Member Functions

 DbType ()
 Standard constructor. More...
 
 DbType (int value)
 Constructor with initializer from. More...
 
 DbType (const DbType &)=default
 Default copy constructor. More...
 
 ~DbType ()=default
 Standard destructor. More...
 
DbTypeoperator= (const DbType &typ)
 Assignment operator. More...
 
bool operator== (const DbType &typ) const
 Equal operator. More...
 
bool operator< (const DbType &typ) const
 Operator less. More...
 
int type () const
 Access to full type. More...
 
int majorType () const
 Access to major type. More...
 
int minorType () const
 Access to minor type. More...
 
bool match (DbType typ) const
 Check if types match. More...
 
bool exactMatch (const DbType &typ) const
 
void check () const
 Check if type is within allowed range. More...
 
const std::string storageName () const
 Human readable storage type. More...
 
void missingDriver (DbPrint &str) const
 Error message on missing back-end driver implementation. More...
 
void badStorageType () const
 Error processing on bad storage type. More...
 

Static Public Member Functions

static DbType getType (const std::string &name)
 Access known storage type object by name. More...
 

Static Public Attributes

static constexpr const unsigned int MASK = ~0x0
 MASK: all bits set (All bits set) More...
 
static const int MINOR_MASK = 0xFF
 MINOR type mask (1 low byte set) More...
 
static constexpr const unsigned int MAJOR_MASK = MASK<<8
 MAJOR type mask (3 high bytes set) More...
 

Private Attributes

int m_type
 Database type. More...
 

Detailed Description

Definition at line 31 of file DbType.h.

Constructor & Destructor Documentation

◆ DbType() [1/3]

pool::DbType::DbType ( )
inline

Standard constructor.

Definition at line 45 of file DbType.h.

45 : m_type(0) { }

◆ DbType() [2/3]

pool::DbType::DbType ( int  value)
inline

Constructor with initializer from.

Definition at line 47 of file DbType.h.

47 : m_type(value) { }

◆ DbType() [3/3]

pool::DbType::DbType ( const DbType )
default

Default copy constructor.

◆ ~DbType()

pool::DbType::~DbType ( )
default

Standard destructor.

Member Function Documentation

◆ badStorageType()

void pool::DbType::badStorageType ( ) const

Error processing on bad storage type.

◆ check()

void pool::DbType::check ( ) const
inline

Check if type is within allowed range.

Definition at line 87 of file DbType.h.

87  {
88  // Assume 0xF00 is biggest known mayor type
89  if ( majorType() == 0 || majorType() > 0xF00 ) {
91  }
92  }

◆ exactMatch()

bool pool::DbType::exactMatch ( const DbType typ) const
inline

Definition at line 73 of file DbType.h.

73 { return majorType() == typ.majorType() and minorType() == typ.minorType(); }

◆ getType()

static DbType pool::DbType::getType ( const std::string &  name)
static

Access known storage type object by name.

◆ majorType()

int pool::DbType::majorType ( ) const
inline

Access to major type.

Definition at line 68 of file DbType.h.

68 { return type()&MAJOR_MASK; }

◆ match()

bool pool::DbType::match ( DbType  typ) const
inline

Check if types match.

Definition at line 72 of file DbType.h.

72 { return type() == typ.type(); }

◆ minorType()

int pool::DbType::minorType ( ) const
inline

Access to minor type.

Definition at line 70 of file DbType.h.

70 { return type()&MINOR_MASK; }

◆ missingDriver()

void pool::DbType::missingDriver ( DbPrint str) const

Error message on missing back-end driver implementation.

◆ operator<()

bool pool::DbType::operator< ( const DbType typ) const
inline

Operator less.

Definition at line 63 of file DbType.h.

64  { return (m_type&MAJOR_MASK) < (typ.type()&MAJOR_MASK); }

◆ operator=()

DbType& pool::DbType::operator= ( const DbType typ)
inline

Assignment operator.

Definition at line 53 of file DbType.h.

53  {
54  if ( this != &typ ) {
55  m_type = typ.type();
56  }
57  return *this;
58  }

◆ operator==()

bool pool::DbType::operator== ( const DbType typ) const
inline

Equal operator.

Definition at line 60 of file DbType.h.

61  { return (m_type&MAJOR_MASK) == (typ.type()&MAJOR_MASK); }

◆ storageName()

const std::string pool::DbType::storageName ( ) const

Human readable storage type.

◆ type()

int pool::DbType::type ( ) const
inline

Access to full type.

Definition at line 66 of file DbType.h.

66 { return m_type; }

Member Data Documentation

◆ m_type

int pool::DbType::m_type
private

Database type.

Definition at line 34 of file DbType.h.

◆ MAJOR_MASK

constexpr const unsigned int pool::DbType::MAJOR_MASK = MASK<<8
staticconstexpr

MAJOR type mask (3 high bytes set)

Definition at line 41 of file DbType.h.

◆ MASK

constexpr const unsigned int pool::DbType::MASK = ~0x0
staticconstexpr

MASK: all bits set (All bits set)

Definition at line 37 of file DbType.h.

◆ MINOR_MASK

const int pool::DbType::MINOR_MASK = 0xFF
static

MINOR type mask (1 low byte set)

Definition at line 39 of file DbType.h.


The documentation for this class was generated from the following file:
athena.value
value
Definition: athena.py:122
pool::DbType::MAJOR_MASK
static constexpr const unsigned int MAJOR_MASK
MAJOR type mask (3 high bytes set)
Definition: DbType.h:41
pool::DbType::type
int type() const
Access to full type.
Definition: DbType.h:66
pool::DbType::MINOR_MASK
static const int MINOR_MASK
MINOR type mask (1 low byte set)
Definition: DbType.h:39
pool::DbType::m_type
int m_type
Database type.
Definition: DbType.h:34
pool::DbType::minorType
int minorType() const
Access to minor type.
Definition: DbType.h:70
pool::DbType::majorType
int majorType() const
Access to major type.
Definition: DbType.h:68
pool::DbType::badStorageType
void badStorageType() const
Error processing on bad storage type.