1 #include "Alignment/Geners/interface/IOException.hh"
6 #include "Alignment/Geners/interface/CharBuffer.hh"
7 #include "Alignment/Geners/interface/binaryIO.hh"
11 unsigned long long tmp = 0ULL;
12 const char *
buf = buf_.getPutBuffer(&tmp);
19 unsigned long long tmp = 0ULL;
20 buf_.getPutBuffer(&tmp);
22 throw gs::IOLengthError(
"In CharBuffer::size: buffer is too large");
23 return static_cast<unsigned long>(
tmp);
26 void CharBuffer::restore(
const ClassId &
id, std::istream &
in, CharBuffer *buf) {
27 static const ClassId current(ClassId::makeId<CharBuffer>());
30 current.ensureSameId(
id);
32 unsigned long long tmp = 0ULL;
37 const unsigned locLen = 4096;
39 std::streambuf *inbuf = in.rdbuf();
40 std::streambuf *outbuf = buf->rdbuf();
42 while (tmp > locLen) {
43 inbuf->sgetn(local, locLen);
44 outbuf->sputn(local, locLen);
48 inbuf->sgetn(local, tmp);
49 outbuf->sputn(local, tmp);
52 throw IOReadFailure(
"In gs::CharBuffer::restore: input stream failure");
54 throw IOWriteFailure(
"In gs::CharBuffer::restore: buffer stream failure");
58 unsigned long long tmp = 0ULL;
59 const char *buf = buf_.getPutBuffer(&tmp);
60 unsigned long long tmp2 = 0ULL;
61 const char *buf2 = r.buf_.getPutBuffer(&tmp2);
64 return memcmp(buf, buf2, tmp) == 0;
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
tuple size
Write out results.