#include <cassert>
#include <sstream>
#include "Alignment/Geners/interface/AbsArchive.hh"
#include "Alignment/Geners/interface/IOException.hh"
Go to the source code of this file.
|
static std::string | local_error_message (gs::AbsArchive &ar, const gs::AbsRecord &record, const char *failedAction) |
|
gs::AbsArchive & | operator<< (gs::AbsArchive &ar, const gs::AbsRecord &record) |
|
static std::string local_error_message |
( |
gs::AbsArchive & |
ar, |
|
|
const gs::AbsRecord & |
record, |
|
|
const char * |
failedAction |
|
) |
| |
|
static |
Definition at line 22 of file AbsArchive.cc.
Referenced by operator<<().
26 std::ostringstream err;
27 err <<
"In operator<<(gs::AbsArchive& ar, const gs::AbsRecord& record): "
28 <<
"failed to " << failedAction <<
" to the archive \""
29 << ar.name() <<
"\" for item with type \""
30 <<
record.type().name() <<
"\", name \""
31 <<
record.name() <<
"\", and category \""
32 <<
record.category() <<
'"';
gs::AbsArchive& operator<< |
( |
gs::AbsArchive & |
ar, |
|
|
const gs::AbsRecord & |
record |
|
) |
| |
Definition at line 36 of file AbsArchive.cc.
References newFWLiteAna::base, delta, and local_error_message().
39 if (
record.id())
throw gs::IOInvalidArgument(
40 "In operator<<(gs::AbsArchive& ar, const gs::AbsRecord& record): "
41 "records can not be reused");
48 std::ostream& os = ar.outputStream();
49 std::streampos
base = os.tellp();
50 std::ostream& compressed = ar.compressedStream(os);
53 if (!
record.writeData(compressed))
56 const unsigned compressCode = ar.flushCompressedRecord(compressed);
59 ar,
record,
"transfer compressed data"));
62 std::streamoff off = os.tellp() -
base;
63 long long delta = off;
67 const unsigned long long id = ar.addToCatalog(
record, compressCode, delta);
70 ar,
record,
"add catalog entry"));
78 ar.lastItemLength_ =
delta;
static std::string local_error_message(gs::AbsArchive &ar, const gs::AbsRecord &record, const char *failedAction)