/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/Geners/interface/BinaryFileArchive.hh
64 строки
2 KB
Cms Build
Clang-Format
08 май 2019, 15:16
08 май 2019, 15:16
7614b05
Код
Авторство
О чём код?
#ifndef GENERS_BINARYFILEARCHIVE_HH_ #define GENERS_BINARYFILEARCHIVE_HH_ #include <cassert> #include "Alignment/Geners/interface/BinaryArchiveBase.hh" #include "Alignment/Geners/interface/CatalogIO.hh" namespace gs { class BinaryFileArchive : public BinaryArchiveBase { public: // See the note inside the "BinaryArchiveBase.hh" header // for the meaning of the "mode" argument BinaryFileArchive(const char *basename, const char *mode, const char *annotation = nullptr, unsigned dataFileBufferSize = 1048576U, unsigned catalogFileBufferSize = 131072U); ~BinaryFileArchive() override; void flush() override; private: void writeCatalog(); void releaseBuffers(); template <class Catalog> void readCatalog() { assert(!catalog()); unsigned compressionMode; setCatalog( readBinaryCatalog<Catalog>(catStream_, &compressionMode, &catalogMergeLevel_, &catalogAnnotations_, true)); assert(catalog()); setCompressionMode(compressionMode); } // The following methods have to be overriden from the base std::ostream &plainOutputStream() override; std::istream &plainInputStream(unsigned long long id, unsigned *compressionCode, unsigned long long *length) override; unsigned long long addToCatalog(const AbsRecord &record, unsigned compressionCode, unsigned long long itemLength) override; char *filebuf_; char *catabuf_; std::string annotation_; std::string dataFileName_; std::string catalogFileName_; std::string dataFileURI_; std::fstream dataStream_; std::fstream catStream_; std::streampos lastpos_; std::streampos jumppos_; std::vector<std::string> catalogAnnotations_; unsigned catalogMergeLevel_; bool annotationsMerged_; bool streamFlushed_; }; } // namespace gs #endif // GENERS_BINARYFILEARCHIVE_HH_