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

Description: Definition an option to be supplied to database objects. More...

#include <StorageSvc/DbOption.h>

Collaboration diagram for pool::DbOption:

Classes

union  Value

Public Member Functions

template<class T>
 DbOption (const std::string &nam, const std::string &opt, T value)
 Initializing constructor.
 DbOption (const std::string &nam, const std::string &opt="")
 Initializing constructor with type definition.
const std::string & option () const
 Access to column name.
const std::string & name () const
 Access to column name.
DbColumn::Type type () const
 Integer type identifier.
template<class T>
StatusCode setValue (T value)
 Set the option value.
template<class T>
StatusCode getValue (T &value) const
 Read the option value.
StatusCode i_setValue (const std::type_info &typ, const void *value)
 Set the option value.
StatusCode i_getValue (const std::type_info &typ, void *value) const
 Read the option value.
std::string typeName () const
 Access to OS independent type name.

Public Attributes

Value m_value {}
 Buffer holding option value.
DbColumn::Type m_type
 Option data type.
std::string m_name
 Option name identifier.
std::string m_opt
 Optional identifier.

Detailed Description

Description: Definition an option to be supplied to database objects.

Note: For any pointer argument, values are not copied. The values must outlive the lifetime of the DbOption.

Author
M.Frank
Version
1.0

Definition at line 36 of file DbOption.h.

Constructor & Destructor Documentation

◆ DbOption() [1/2]

template<class T>
pool::DbOption::DbOption ( const std::string & nam,
const std::string & opt,
T value )
inline

Initializing constructor.

Definition at line 58 of file DbOption.h.

62 { i_setValue(typeid(T), &value).ignore(); }
std::string m_name
Option name identifier.
Definition DbOption.h:52
StatusCode i_setValue(const std::type_info &typ, const void *value)
Set the option value.
DbColumn::Type m_type
Option data type.
Definition DbOption.h:50
std::string m_opt
Optional identifier.
Definition DbOption.h:54

◆ DbOption() [2/2]

pool::DbOption::DbOption ( const std::string & nam,
const std::string & opt = "" )
inline

Initializing constructor with type definition.

Definition at line 65 of file DbOption.h.

67 { }

Member Function Documentation

◆ getValue()

template<class T>
StatusCode pool::DbOption::getValue ( T & value) const
inline

Read the option value.

Definition at line 81 of file DbOption.h.

82 { return i_getValue(typeid(T), &value); }
StatusCode i_getValue(const std::type_info &typ, void *value) const
Read the option value.

◆ i_getValue()

StatusCode pool::DbOption::i_getValue ( const std::type_info & typ,
void * value ) const

Read the option value.

◆ i_setValue()

StatusCode pool::DbOption::i_setValue ( const std::type_info & typ,
const void * value )

Set the option value.

◆ name()

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

Access to column name.

Definition at line 72 of file DbOption.h.

72{ return m_name; }

◆ option()

const std::string & pool::DbOption::option ( ) const
inline

Access to column name.

Definition at line 70 of file DbOption.h.

70{ return m_opt; }

◆ setValue()

template<class T>
StatusCode pool::DbOption::setValue ( T value)
inline

Set the option value.

Definition at line 77 of file DbOption.h.

78 { return i_setValue(typeid(T), &value); }

◆ type()

DbColumn::Type pool::DbOption::type ( ) const
inline

Integer type identifier.

Definition at line 74 of file DbOption.h.

74{ return m_type; }

◆ typeName()

std::string pool::DbOption::typeName ( ) const
inline

Access to OS independent type name.

Definition at line 91 of file DbOption.h.

91{ return DbColumn::typeName(m_type); }
const std::string & typeName() const
Access to OS independent type name.
Definition DbColumn.h:101

Member Data Documentation

◆ m_name

std::string pool::DbOption::m_name

Option name identifier.

Definition at line 52 of file DbOption.h.

◆ m_opt

std::string pool::DbOption::m_opt

Optional identifier.

Definition at line 54 of file DbOption.h.

◆ m_type

DbColumn::Type pool::DbOption::m_type

Option data type.

Definition at line 50 of file DbOption.h.

◆ m_value

Value pool::DbOption::m_value {}

Buffer holding option value.

Definition at line 48 of file DbOption.h.

48{};

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