1 #include "Alignment/Geners/interface/IOException.hh" 5 #include "Alignment/Geners/interface/StringArchive.hh" 6 #include "Alignment/Geners/interface/streamposIO.hh" 10 std::vector<unsigned long long> idlist;
12 const unsigned long nfound = idlist.size();
13 for (
unsigned long i = 0;
i <
nfound; ++
i) {
14 std::shared_ptr<const CatalogEntry> pentry = catalog_.retrieveEntry(idlist[
i]);
20 std::istream &StringArchive::inputStream(
const unsigned long long id,
long long *sz) {
22 throw gs::IOInvalidArgument(
"In gs::StringArchive::inputStream: invalid item id");
25 unsigned long long itemLen;
26 if (!catalog_.retrieveStreampos(
id, &cCode, &itemLen, &
pos)) {
27 std::ostringstream os;
28 os <<
"In gs::StringArchive::inputStream: " 29 <<
"failed to locate item with id " <<
id;
30 throw gs::IOInvalidArgument(os.str());
38 bool StringArchive::isEqual(
const AbsArchive &cata)
const {
39 const StringArchive &
r =
static_cast<const StringArchive &
>(cata);
40 return lastpos_ ==
r.lastpos_ &&
name() ==
r.name() && stream_ ==
r.stream_ && catalog_ ==
r.catalog_;
44 write_pod(
of, lastpos_);
46 return !
of.fail() && stream_.classId().write(
of) && stream_.write(
of) && catalog_.classId().write(
of) &&
51 static const ClassId current(ClassId::makeId<StringArchive>());
52 current.ensureSameId(
id);
54 std::streampos lastpos;
55 read_pod(
in, &lastpos);
59 throw IOReadFailure(
"In gs::StringArchive::read: input stream failure");
60 CPP11_auto_ptr<StringArchive> archive(
new StringArchive(nam.c_str()));
61 archive->lastpos_ = lastpos;
62 ClassId streamId(
in, 1);
63 CharBuffer::restore(streamId,
in, &archive->stream_);
67 archive->catalog_ = *
p;
68 return archive.release();
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)