CondCore
CondDB
src
Binary.cc
Go to the documentation of this file.
1
#include "
CondCore/CondDB/interface/Binary.h
"
2
#include "
CondCore/CondDB/interface/Exception.h
"
3
//
4
#include "CoralBase/Blob.h"
5
//
6
#include <cstring>
7
8
#include <openssl/sha.h>
9
#include <cstring>
10
11
cond::Binary::Binary
() : m_data(new
coral
::Blob(0)) {}
12
13
cond::Binary::Binary
(
const
void
*
data
,
size_t
size
) : m_data(new
coral
::Blob(
size
)) {
14
::memcpy(
m_data
->startingAddress(),
data
,
size
);
15
}
16
17
cond::Binary::Binary
(
const
coral::Blob&
data
) : m_data(new
coral
::Blob(
data
.
size
())) {
18
::memcpy(
m_data
->startingAddress(),
data
.startingAddress(),
data
.size());
19
}
20
21
cond::Binary::Binary
(
const
Binary
& rhs) : m_data(rhs.m_data) {}
22
23
cond::Binary
&
cond::Binary::operator=
(
const
Binary
& rhs) {
24
if
(
this
!= &rhs) {
25
m_data = rhs.
m_data
;
26
}
27
return
*
this
;
28
}
29
30
const
coral::Blob&
cond::Binary::get
()
const
{
return
*m_data; }
31
32
void
cond::Binary::copy
(
const
std::string
&
source
) {
33
m_data.reset(
new
coral::Blob(
source
.size()));
34
::memcpy(m_data->startingAddress(),
source
.c_str(),
source
.size());
35
}
36
37
const
void
*
cond::Binary::data
()
const
{
38
if
(!m_data.get())
39
throwException
(
"Binary data can't be accessed."
,
"Binary::data"
);
40
return
m_data->startingAddress();
41
}
42
void
*
cond::Binary::data
() {
43
if
(!m_data.get())
44
throwException
(
"Binary data can't be accessed."
,
"Binary::data"
);
45
return
m_data->startingAddress();
46
}
47
48
size_t
cond::Binary::size
()
const
{
49
if
(!m_data.get())
50
throwException
(
"Binary data can't be accessed."
,
"Binary::size"
);
51
return
m_data->size();
52
}
Exception.h
cond::Binary
Definition:
Binary.h:15
cond::Binary::data
const void * data() const
Definition:
Binary.cc:37
cond::Binary::copy
void copy(const std::string &source)
Definition:
Binary.cc:32
cond::Binary::size
size_t size() const
Definition:
Binary.cc:48
coral
Definition:
Binary.h:9
source
static const std::string source
Definition:
EdmProvDump.cc:47
cond::Binary::operator=
Binary & operator=(const Binary &rhs)
Definition:
Binary.cc:23
cond::Binary::get
const coral::Blob & get() const
Definition:
Binary.cc:30
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
cond::Binary::m_data
std::shared_ptr< coral::Blob > m_data
Definition:
Binary.h:38
Binary.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
cond::Binary::Binary
Binary()
Definition:
Binary.cc:11
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
cond::throwException
void throwException(const std::string &message, const std::string &methodName)
Definition:
Exception.cc:18
Generated for CMSSW Reference Manual by
1.8.16