16 m_stream.open(filename, std::ios::binary);
17 if (!m_stream.is_open()) {
18 SIO_THROW(sio::error_code::not_open,
"Couldn't open output stream '" + filename +
"'");
23 sio::block_list blocks;
24 blocks.emplace_back(std::make_shared<SIOVersionBlock>(podio::version::build_version));
34 const std::vector<std::string>& collsToWrite) {
35 std::vector<sio_utils::StoreCollection> collections;
36 collections.reserve(collsToWrite.size());
37 for (
const auto& name : collsToWrite) {
45 sio::block_list tableBlocks;
54 auto edmDefMap = std::make_shared<podio::SIOMapBlock<std::string, std::string>>(
57 sio::block_list blocks;
58 blocks.push_back(edmDefMap);
62 blocks.emplace_back(std::make_shared<SIOFileTOCRecordBlock>(&m_tocRecord));
69 uint64_t finalWords = (((uint64_t)sio_helpers::SIOTocMarker) << 32) | ((uint64_t)tocStartPos & 0xffffffff);
70 m_stream.write(
reinterpret_cast<char*
>(&finalWords),
sizeof(finalWords));
std::vector< std::tuple< std::string, std::string > > getDatamodelDefinitionsToWrite() const
Get all the names and JSON definitions that need to be written.
void registerDatamodelDefinition(const podio::CollectionBase *coll, const std::string &name)
podio::CollectionIDTable getCollectionIDTableForWrite() const
std::vector< std::string > getAvailableCollections() const
const podio::GenericParameters & getParameters() const
const podio::CollectionBase * getCollectionForWrite(const std::string &name) const
static SIOBlockLibraryLoader & instance()
void addRecord(const std::string &name, PositionType startPos)
void writeFrame(const podio::Frame &frame, const std::string &category)
SIOFrameWriter(const std::string &filename)
sio::block_list createBlocks(const std::vector< StoreCollection > &collections, const podio::GenericParameters ¶meters)
Create all blocks to store the passed collections and parameters into a record.
sio::ifstream::pos_type writeRecord(const sio::block_list &blocks, const std::string &recordName, sio::ofstream &stream, std::size_t initBufferSize=sio::mbyte, bool compress=true)
Write the passed record and return where it starts in the file.
std::shared_ptr< SIOCollectionIDTableBlock > createCollIDBlock(const std::vector< StoreCollection > &collections, const podio::CollectionIDTable &collIdTable)
Create the collection ID block from the passed collections.