test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Binary.cc
Go to the documentation of this file.
3 //
4 #include "CoralBase/Blob.h"
5 //
6 #include <cstring>
7 
8 #include <openssl/sha.h>
9 #include <cstring>
10 
12  m_data( new coral::Blob(0) ){
13 }
14 
15 cond::Binary::Binary( const void* data, size_t size ):
16  m_data( new coral::Blob( size ) ){
17  ::memcpy( m_data->startingAddress(), data, size );
18 }
19 
20 cond::Binary::Binary( const coral::Blob& data ):
21  m_data( new coral::Blob(data.size()) ){
22  ::memcpy( m_data->startingAddress(), data.startingAddress(), data.size() );
23 }
24 
26  m_data( rhs.m_data ),
27  m_object( rhs.m_object ){
28 }
29 
31  if( this != &rhs ) {
32  m_data = rhs.m_data;
33  m_object = rhs.m_object;
34  }
35  return *this;
36 }
37 
38 const coral::Blob& cond::Binary::get() const {
39  return *m_data;
40 }
41 
43  m_data.reset( new coral::Blob( source.size() ) );
44  ::memcpy( m_data->startingAddress(), source.c_str(), source.size() );
45  m_object = ora::Object();
46 }
47 
48 const void* cond::Binary::data() const {
49  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::data");
50  return m_data->startingAddress();
51 }
53  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::data");
54  return m_data->startingAddress();
55 }
56 
57 size_t cond::Binary::size() const {
58  if(!m_data.get()) throwException( "Binary data can't be accessed.","Binary::size");
59  return m_data->size();
60 }
61 
63  return m_object;
64 }
65 
67  m_object = object;
68  m_data.reset();
69 }
70 
71 
ora::Object m_object
Definition: Binary.h:50
void fromOraObject(const ora::Object &object)
Definition: Binary.cc:66
size_t size() const
Definition: Binary.cc:57
std::shared_ptr< coral::Blob > m_data
Definition: Binary.h:47
Binary & operator=(const Binary &rhs)
Definition: Binary.cc:30
void copy(const std::string &source)
Definition: Binary.cc:42
ora::Object oraObject() const
Definition: Binary.cc:62
const void * data() const
Definition: Binary.cc:48
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
list object
Definition: dbtoconf.py:77
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const coral::Blob & get() const
Definition: Binary.cc:38
static std::string const source
Definition: EdmProvDump.cc:43
tuple size
Write out results.