CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cond::Binary Class Reference

#include <Binary.h>

Public Member Functions

 Binary ()
 
template<typename T >
 Binary (const T &object)
 
 Binary (const void *data, size_t size)
 
 Binary (const coral::Blob &data)
 
 Binary (const Binary &rhs)
 
void copy (const std::string &source)
 
const void * data () const
 
void * data ()
 
void fromOraObject (const ora::Object &object)
 
const coral::Blob & get () const
 
Binaryoperator= (const Binary &rhs)
 
ora::Object oraObject () const
 
size_t size () const
 

Private Attributes

std::shared_ptr< coral::Blob > m_data
 
ora::Object m_object
 

Detailed Description

Definition at line 18 of file Binary.h.

Constructor & Destructor Documentation

cond::Binary::Binary ( )

Definition at line 11 of file Binary.cc.

11  :
12  m_data( new coral::Blob(0) ){
13 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
template<typename T >
cond::Binary::Binary ( const T object)
explicit

Definition at line 53 of file Binary.h.

53  :
54  m_object( object ){
55  }
ora::Object m_object
Definition: Binary.h:50
cond::Binary::Binary ( const void *  data,
size_t  size 
)

Definition at line 15 of file Binary.cc.

References data(), m_data, and size().

15  :
16  m_data( new coral::Blob( size ) ){
17  ::memcpy( m_data->startingAddress(), data, size );
18 }
size_t size() const
Definition: Binary.cc:57
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
const void * data() const
Definition: Binary.cc:48
cond::Binary::Binary ( const coral::Blob &  data)
explicit

Definition at line 20 of file Binary.cc.

References m_data.

20  :
21  m_data( new coral::Blob(data.size()) ){
22  ::memcpy( m_data->startingAddress(), data.startingAddress(), data.size() );
23 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
const void * data() const
Definition: Binary.cc:48
cond::Binary::Binary ( const Binary rhs)

Definition at line 25 of file Binary.cc.

25  :
26  m_data( rhs.m_data ),
27  m_object( rhs.m_object ){
28 }
ora::Object m_object
Definition: Binary.h:50
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47

Member Function Documentation

void cond::Binary::copy ( const std::string &  source)

Definition at line 42 of file Binary.cc.

Referenced by cond::persistency::PAYLOAD::Table::insert().

42  {
43  m_data.reset( new coral::Blob( source.size() ) );
44  ::memcpy( m_data->startingAddress(), source.c_str(), source.size() );
46 }
ora::Object m_object
Definition: Binary.h:50
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
static std::string const source
Definition: EdmProvDump.cc:43
const void * cond::Binary::data ( ) const

Definition at line 48 of file Binary.cc.

References cond::throwException().

Referenced by cuy.FindIssue::__init__(), Binary(), cond::deserialize(), and cond::persistency::makeHash().

48  {
49  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::data");
50  return m_data->startingAddress();
51 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
void * cond::Binary::data ( )

Definition at line 52 of file Binary.cc.

References cond::throwException().

Referenced by cuy.FindIssue::__init__().

52  {
53  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::data");
54  return m_data->startingAddress();
55 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
void cond::Binary::fromOraObject ( const ora::Object object)

Definition at line 66 of file Binary.cc.

References dbtoconf::object.

Referenced by cond::persistency::OraPayloadTable::select().

66  {
67  m_object = object;
68  m_data.reset();
69 }
ora::Object m_object
Definition: Binary.h:50
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
list object
Definition: dbtoconf.py:77
const coral::Blob & cond::Binary::get ( void  ) const
cond::Binary & cond::Binary::operator= ( const Binary rhs)

Definition at line 30 of file Binary.cc.

References m_data, and m_object.

30  {
31  if( this != &rhs ) {
32  m_data = rhs.m_data;
33  m_object = rhs.m_object;
34  }
35  return *this;
36 }
ora::Object m_object
Definition: Binary.h:50
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
ora::Object cond::Binary::oraObject ( ) const

Definition at line 62 of file Binary.cc.

Referenced by cond::deserialize(), and cond::persistency::OraPayloadTable::insertIfNew().

62  {
63  return m_object;
64 }
ora::Object m_object
Definition: Binary.h:50
size_t cond::Binary::size ( void  ) const

Definition at line 57 of file Binary.cc.

References cond::throwException().

Referenced by Binary(), cond::deserialize(), cond::persistency::PAYLOAD::Table::insert(), and cond::persistency::makeHash().

57  {
58  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::size");
59  return m_data->size();
60 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17

Member Data Documentation

std::shared_ptr<coral::Blob> cond::Binary::m_data
private

Definition at line 47 of file Binary.h.

Referenced by Binary(), and operator=().

ora::Object cond::Binary::m_object
private

Definition at line 50 of file Binary.h.

Referenced by operator=().