#include <cassert>
#include <sstream>
#include "Alignment/Geners/interface/AbsArchive.hh"
#include "Alignment/Geners/interface/IOException.hh"
Go to the source code of this file.
#define GS_STREAM_COPY_BUFFER_SIZE 65536 |
static void archive_stream_copy |
( |
std::istream & |
in, |
|
|
std::size_t |
count, |
|
|
std::ostream & |
out |
|
) |
| |
|
static |
static std::string local_error_message |
( |
gs::AbsArchive & |
ar, |
|
|
const gs::AbsRecord & |
record, |
|
|
const char * |
failedAction |
|
) |
| |
|
static |
Definition at line 143 of file AbsArchive.cc.
Referenced by operator<<().
147 std::ostringstream err;
148 err <<
"In operator<<(gs::AbsArchive& ar, const gs::AbsRecord& record): " 149 <<
"failed to " << failedAction <<
" to the archive \"" 150 << ar.name() <<
"\" for item with type \"" 151 <<
record.type().name() <<
"\", name \"" 152 <<
record.name() <<
"\", and category \"" 153 <<
record.category() <<
'"';
gs::AbsArchive& operator<< |
( |
gs::AbsArchive & |
ar, |
|
|
const gs::AbsRecord & |
record |
|
) |
| |
Definition at line 157 of file AbsArchive.cc.
References runEdmFileComparison::base, delta, triggerObjects_cff::id, and local_error_message().
160 if (
record.id())
throw gs::IOInvalidArgument(
161 "In operator<<(gs::AbsArchive& ar, const gs::AbsRecord& record): " 162 "records can not be reused");
169 std::ostream& os = ar.outputStream();
170 std::streampos
base = os.tellp();
171 std::ostream& compressed = ar.compressedStream(os);
174 if (!
record.writeData(compressed))
177 const unsigned compressCode = ar.flushCompressedRecord(compressed);
180 ar,
record,
"transfer compressed data"));
183 std::streamoff off = os.tellp() -
base;
184 const long long delta = off;
185 assert(delta >= 0LL);
188 const unsigned long long id = ar.addToCatalog(
record, compressCode, delta);
191 ar,
record,
"add catalog entry"));
199 ar.lastItemLength_ =
delta;
base
Make Sure CMSSW is Setup ##.
static std::string local_error_message(gs::AbsArchive &ar, const gs::AbsRecord &record, const char *failedAction)