12 char *p =
reinterpret_cast<char *
>(&i);
19 std::size_t nbytes =
vec.size() *
sizeof(
Channel);
21 void* adr = blob.startingAddress();
22 for ( std::vector<HWIdentifier>::const_iterator i=
vec.begin();
23 i !=
vec.end(); ++i) {
25 *ch = i->get_identifier32().get_compact();
26 adr =
static_cast<void*
>(ch+1);
32 std::size_t stateSizeInBlob,
36 std::size_t currentStateSize,
40 log << MSG::ERROR <<
"BLOB endian-ness and computer endian-ness differ."
41 <<
" This version cannot decode such BLOBs" <<
endmsg;
44 if ( chanSize !=
sizeof(
Channel)) {
45 log << MSG::ERROR <<
"The word size for HWidentifier in the BLOB ("
46 << chanSize <<
") diifers from the HWIdentifier::value_type size "
48 log << MSG::ERROR <<
"This version cannot decode such BLOBs" <<
endmsg;
51 if ( stateSizeInBlob != 0 && stateSizeInBlob != currentStateSize) {
52 log << MSG::ERROR <<
"The word size for LArBadChannel or LArBadFeb in the BLOB ("
53 << stateSizeInBlob <<
") diifers from the runtime BitWord size "
54 << currentStateSize <<
endmsg;
55 log << MSG::ERROR <<
"This version cannot decode such BLOBs" <<
endmsg;
59 if (blobp->size() % step != 0) {
60 log << MSG::ERROR <<
"BLOB size (" << blobp->size()
61 <<
") is not an exact multiple of content size "
63 log << MSG::ERROR <<
"The BLOB is probably corrupted." <<
endmsg;
78 std::vector<HWIdentifier>
result;
80 if (version == 1) step =
sizeof(
Channel) ;
83 if (!
checkBlob( blobp, chanSize, 0, endian, version, step, 0, log)) {
86 std::size_t vecSize = blobp->size() / step;
88 const void* adr = blobp->startingAddress();
89 for (std::size_t i=0; i< vecSize; i++) {
91 adr =
static_cast<const void*
>(ch+1);
std::vector< size_t > vec
bool checkBlob(const coral::Blob *blobp, std::size_t chanSize, std::size_t stateSizeInBlob, int endian, int, std::size_t step, std::size_t currentStateSize, MsgStream &log)
Identifier32::value_type Channel
std::vector< HWIdentifier > decodeFebBlobV1(const coral::Blob *blobp, std::size_t chanSize, int endian, int version, MsgStream &log)
void fillFebBlobV1(const std::vector< HWIdentifier > &vec, coral::Blob &blob)