test
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 ()
 
 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 ()
 
const coral::Blob & get () const
 
Binaryoperator= (const Binary &rhs)
 
size_t size () const
 

Private Attributes

std::shared_ptr< coral::Blob > m_data
 

Detailed Description

Definition at line 15 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:38
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:54
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:38
const void * data() const
Definition: Binary.cc:45
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:38
const void * data() const
Definition: Binary.cc:45
cond::Binary::Binary ( const Binary rhs)

Definition at line 25 of file Binary.cc.

25  :
26  m_data( rhs.m_data ){
27 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:38

Member Function Documentation

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

Definition at line 40 of file Binary.cc.

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

40  {
41  m_data.reset( new coral::Blob( source.size() ) );
42  ::memcpy( m_data->startingAddress(), source.c_str(), source.size() );
43 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:38
static std::string const source
Definition: EdmProvDump.cc:43
const void * cond::Binary::data ( ) const

Definition at line 45 of file Binary.cc.

References cond::throwException().

Referenced by cuy.FindIssue::__init__(), data_sources.node::__str__(), data_sources.json_list::as_dicts(), data_sources.json_list::as_table(), Binary(), cond::default_deserialize(), data_sources.json_list::get_members(), data_sources.json_list::last(), and cond::persistency::makeHash().

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

Definition at line 49 of file Binary.cc.

References cond::throwException().

Referenced by cuy.FindIssue::__init__(), data_sources.node::__str__(), data_sources.json_list::as_dicts(), data_sources.json_list::as_table(), data_sources.json_list::get_members(), and data_sources.json_list::last().

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

Definition at line 29 of file Binary.cc.

References m_data.

29  {
30  if( this != &rhs ) {
31  m_data = rhs.m_data;
32  }
33  return *this;
34 }
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:38
size_t cond::Binary::size ( void  ) const

Definition at line 54 of file Binary.cc.

References cond::throwException().

Referenced by ntuple._Collection::__iter__(), ntuple._Collection::__len__(), Binary(), cond::default_deserialize(), cond::persistency::PAYLOAD::Table::insert(), and cond::persistency::makeHash().

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

Member Data Documentation

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

Definition at line 38 of file Binary.h.

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