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

Keeps information about storage technology. More...

#include <StorageSvc/DbType.h>

Collaboration diagram for DbType:

Public Member Functions

 DbType ()
 Standard constructor.
 DbType (int value)
 Constructor with initializer from.
 DbType (const DbType &)=default
 Default copy constructor.
 ~DbType ()=default
 Standard destructor.
DbType & operator= (const DbType &typ)
 Assignment operator.
bool operator== (const DbType &typ) const
 Equal operator.
bool operator< (const DbType &typ) const
 Operator less.
int type () const
 Access to full type.
int majorType () const
 Access to major type.
int minorType () const
 Access to minor type.
bool match (DbType typ) const
 Check if types match.
bool exactMatch (const DbType &typ) const
const std::string storageName () const
 Human readable storage type.

Static Public Member Functions

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

Static Public Attributes

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

Private Attributes

int m_type
 Database type.

Detailed Description

Keeps information about storage technology.

Definition at line 15 of file DbType.h.

Constructor & Destructor Documentation

◆ DbType() [1/3]

DbType::DbType ( )
inline

Standard constructor.

Definition at line 29 of file DbType.h.

29: m_type(0) { }
int m_type
Database type.
Definition DbType.h:18

◆ DbType() [2/3]

DbType::DbType ( int value)
inline

Constructor with initializer from.

Definition at line 31 of file DbType.h.

31: m_type(value) { }

◆ DbType() [3/3]

DbType::DbType ( const DbType & )
default

Default copy constructor.

◆ ~DbType()

DbType::~DbType ( )
default

Standard destructor.

Member Function Documentation

◆ exactMatch()

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

Definition at line 57 of file DbType.h.

57{ return majorType() == typ.majorType() and minorType() == typ.minorType(); }
int minorType() const
Access to minor type.
Definition DbType.h:54
int majorType() const
Access to major type.
Definition DbType.h:52

◆ getType()

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

Access known storage type object by name.

◆ majorType()

int DbType::majorType ( ) const
inline

Access to major type.

Definition at line 52 of file DbType.h.

52{ return type()&MAJOR_MASK; }
static const constexpr unsigned int MAJOR_MASK
MAJOR type mask (3 high bytes set).
Definition DbType.h:25
int type() const
Access to full type.
Definition DbType.h:50

◆ match()

bool DbType::match ( DbType typ) const
inline

Check if types match.

Definition at line 56 of file DbType.h.

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

◆ minorType()

int DbType::minorType ( ) const
inline

Access to minor type.

Definition at line 54 of file DbType.h.

54{ return type()&MINOR_MASK; }
static const int MINOR_MASK
MINOR type mask (1 low byte set).
Definition DbType.h:23

◆ operator<()

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

Operator less.

Definition at line 47 of file DbType.h.

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

◆ operator=()

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

Assignment operator.

Definition at line 37 of file DbType.h.

37 {
38 if ( this != &typ ) {
39 m_type = typ.type();
40 }
41 return *this;
42 }

◆ operator==()

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

Equal operator.

Definition at line 44 of file DbType.h.

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

◆ storageName()

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

Human readable storage type.

◆ type()

int DbType::type ( ) const
inline

Access to full type.

Definition at line 50 of file DbType.h.

50{ return m_type; }

Member Data Documentation

◆ m_type

int DbType::m_type
private

Database type.

Definition at line 18 of file DbType.h.

◆ MAJOR_MASK

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

MAJOR type mask (3 high bytes set).

Definition at line 25 of file DbType.h.

◆ MASK

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

MASK: all bits set (All bits set).

Definition at line 21 of file DbType.h.

◆ MINOR_MASK

const int DbType::MINOR_MASK = 0xFF
static

MINOR type mask (1 low byte set).

Definition at line 23 of file DbType.h.


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