4 #include "Alignment/Geners/interface/IOException.hh"
6 #include "Alignment/Geners/interface/binaryIO.hh"
7 #include "Alignment/Geners/interface/CharBuffer.hh"
12 unsigned long long tmp = 0ULL;
13 const char* buf = buf_.getPutBuffer(&tmp);
21 unsigned long long tmp = 0ULL;
22 buf_.getPutBuffer(&tmp);
24 throw gs::IOLengthError(
"In CharBuffer::size: buffer is too large");
25 return static_cast<unsigned long>(
tmp);
28 void CharBuffer::restore(
const ClassId&
id, std::istream&
in,
31 static const ClassId
current(ClassId::makeId<CharBuffer>());
36 unsigned long long tmp = 0ULL;
41 const unsigned locLen = 4096;
43 std::streambuf* inbuf = in.rdbuf();
44 std::streambuf* outbuf = buf->rdbuf();
48 inbuf->sgetn(local, locLen);
49 outbuf->sputn(local, locLen);
54 inbuf->sgetn(local, tmp);
55 outbuf->sputn(local, tmp);
57 if (in.fail())
throw IOReadFailure(
58 "In gs::CharBuffer::restore: input stream failure");
59 if (buf->fail())
throw IOWriteFailure(
60 "In gs::CharBuffer::restore: buffer stream failure");
65 unsigned long long tmp = 0ULL;
66 const char* buf = buf_.getPutBuffer(&tmp);
67 unsigned long long tmp2 = 0ULL;
68 const char* buf2 = r.buf_.getPutBuffer(&tmp2);
71 return memcmp(buf, buf2, tmp) == 0;
bool operator==(const CaloTower &t1, const CaloTower &t2)
std::vector< std::vector< double > > tmp
tuple size
Write out results.