Definition at line 30 of file BlobStreamingService.cc.
cond::BlobStreamingService::BlobStreamingService |
( |
| ) |
|
cond::BlobStreamingService::~BlobStreamingService |
( |
| ) |
|
|
virtual |
boost::shared_ptr< coral::Blob > cond::BlobStreamingService::compress |
( |
const void * |
addr, |
|
|
size_t |
isize |
|
) |
| |
|
staticprivate |
Definition at line 191 of file BlobStreamingService.cc.
References m_idsize, m_offset, reco::formula::startingAddress(), and spu::zerr().
Referenced by write().
192 uLongf destLen = compressBound(isize);
194 boost::shared_ptr<coral::Blob> theBlob(
new coral::Blob(usize));
195 void *
startingAddress = (
unsigned char*)(theBlob->startingAddress())+ m_offset;
196 int zerr = compress2( (
unsigned char*)(startingAddress), &destLen,
197 (
unsigned char*)(addr), isize,
199 if (zerr!=0)
edm::LogError(
"BlobStreamingService")<<
"Compression error " <<
zerr;
200 destLen+=
m_idsize +
sizeof(
unsigned long long);
201 theBlob->resize(destLen);
203 startingAddress = (
unsigned char*)(theBlob->startingAddress())+
m_idsize;
static const size_t m_offset
static const size_t m_idsize
boost::shared_ptr< coral::Blob > cond::BlobStreamingService::expand |
( |
const coral::Blob & |
blobIn | ) |
|
|
staticprivate |
Definition at line 209 of file BlobStreamingService.cc.
References compareJSON::const, m_idsize, m_offset, reco::formula::startingAddress(), and spu::zerr().
Referenced by read().
210 if (
size_t(blobIn.size()) <
m_offset)
return boost::shared_ptr<coral::Blob>(
new coral::Blob());
211 long long csize = blobIn.size() -
m_offset;
214 startingAddress +=
sizeof(
unsigned long long);
215 boost::shared_ptr<coral::Blob> theBlob(
new coral::Blob(usize));
216 uLongf destLen = usize;
217 int zerr = uncompress((
unsigned char *)(theBlob->startingAddress()), &destLen,
218 startingAddress, csize);
219 if (zerr!=0 || usize!=destLen)
220 edm::LogError(
"BlobStreamingService")<<
"uncompressing error " << zerr
221 <<
" original size was " << usize
222 <<
" new size is " << destLen;
static const size_t m_offset
static const size_t m_idsize
int cond::BlobStreamingService::isVectorChar |
( |
edm::TypeWithDict const & |
classDictionary | ) |
|
|
staticprivate |
Definition at line 176 of file BlobStreamingService.cc.
Referenced by read(), and write().
177 if (classDictionary ==
typeid(std::vector<unsigned char>))
return 1;
178 if (classDictionary ==
typeid(std::vector<char>))
return 2;
void cond::BlobStreamingService::read |
( |
const coral::Blob & |
blobData, |
|
|
void * |
addressOfContainer, |
|
|
edm::TypeWithDict const & |
classDictionary |
|
) |
| |
|
overridevirtual |
Reads an object from a Blob and fills-in the container.
Implements ora::IBlobStreamingService.
Definition at line 120 of file BlobStreamingService.cc.
References COMPRESSED_CHARS, COMPRESSED_TBUFFER, expand(), findVariant(), isVectorChar(), relval_steps::k, m_offset, OLD, rootService, and findQualityFiles::v.
Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().
126 rootService->read( blobData, addressOfContainer, classDictionary);
131 boost::shared_ptr<coral::Blob> blobIn =
expand(blobData);
132 rootService->read( *blobIn, addressOfContainer, classDictionary);
137 boost::shared_ptr<coral::Blob> blobIn =
expand(blobData);
147 std::vector<unsigned char> & v = *
reinterpret_cast< std::vector<unsigned char> *
> (addressOfContainer);
149 v.resize(blobIn->size());
150 std::memcpy(&v.front(),blobIn->startingAddress(),v.size());
155 std::vector<char> & v = *
reinterpret_cast< std::vector<char> *
> (addressOfContainer);
157 v.resize(blobIn->size());
158 std::memcpy(&v.front(),blobIn->startingAddress(),v.size());
static const size_t m_offset
static Variant findVariant(const void *address)
static int isVectorChar(edm::TypeWithDict const &classDictionary)
static boost::shared_ptr< coral::Blob > expand(const coral::Blob &blobIn)
boost::shared_ptr< ora::IBlobStreamingService > rootService
boost::shared_ptr< coral::Blob > cond::BlobStreamingService::write |
( |
const void * |
addressOfInputData, |
|
|
edm::TypeWithDict const & |
classDictionary, |
|
|
bool |
useCompression = true |
|
) |
| |
|
overridevirtual |
Implements ora::IBlobStreamingService.
Definition at line 74 of file BlobStreamingService.cc.
References compress(), COMPRESSED_CHARS, COMPRESSED_TBUFFER, isVectorChar(), relval_steps::k, rootService, findQualityFiles::v, and variantIds.
Referenced by pkg.AbstractPkg::generate().
75 boost::shared_ptr<coral::Blob> blobOut;
82 boost::shared_ptr<coral::Blob> buffer =
rootService->write(addressOfInputData, classDictionary);
84 blobOut =
compress(buffer->startingAddress(),buffer->size());
94 std::vector<unsigned char>
const &
v = *
reinterpret_cast< std::vector<unsigned char>
const *
> (addressOfInputData);
95 blobOut =
compress(&v.front(),v.size());
98 blobOut =
rootService->write(addressOfInputData,classDictionary);
104 if( useCompression ){
105 std::vector<char>
const & v = *
reinterpret_cast<std::vector<char>
const *
> (addressOfInputData);
106 blobOut =
compress(&v.front(),v.size());
109 blobOut =
rootService->write(addressOfInputData,classDictionary);
static int isVectorChar(edm::TypeWithDict const &classDictionary)
std::pair< unsigned long long, unsigned long long > uuid
boost::shared_ptr< ora::IBlobStreamingService > rootService
static boost::shared_ptr< coral::Blob > compress(const void *addr, size_t isize)
static uuid const variantIds[nVariants]
const size_t cond::BlobStreamingService::m_idsize =sizeof(uuid) |
|
staticprivate |
const size_t cond::BlobStreamingService::m_offset = m_idsize + sizeof(unsigned long long) |
|
staticprivate |
const size_t cond::BlobStreamingService::nVariants =3 |
|
staticprivate |