#include <SIOFrameWriter.h>
Definition at line 17 of file SIOFrameWriter.h.
◆ SIOFrameWriter() [1/2]
podio::SIOFrameWriter::SIOFrameWriter |
( |
const std::string & |
filename | ) |
|
Definition at line 15 of file SIOFrameWriter.cc.
15 {
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 + "'");
19 }
20
22
23 sio::block_list blocks;
24 blocks.emplace_back(std::make_shared<SIOVersionBlock>(podio::version::build_version));
25
27}
static SIOBlockLibraryLoader & instance()
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.
◆ ~SIOFrameWriter()
podio::SIOFrameWriter::~SIOFrameWriter |
( |
| ) |
|
|
default |
◆ SIOFrameWriter() [2/2]
◆ finish()
void podio::SIOFrameWriter::finish |
( |
| ) |
|
Definition at line 53 of file SIOFrameWriter.cc.
53 {
54 auto edmDefMap = std::make_shared<podio::SIOMapBlock<std::string, std::string>>(
56
57 sio::block_list blocks;
58 blocks.push_back(edmDefMap);
60
61 blocks.clear();
62 blocks.emplace_back(std::make_shared<SIOFileTOCRecordBlock>(&m_tocRecord));
63
65
66
67
68
69 uint64_t finalWords = (((uint64_t)sio_helpers::SIOTocMarker) << 32) | ((uint64_t)tocStartPos & 0xffffffff);
70 m_stream.write(reinterpret_cast<char*>(&finalWords), sizeof(finalWords));
71
72 m_stream.close();
73}
std::vector< std::tuple< std::string, std::string > > getDatamodelDefinitionsToWrite() const
Get all the names and JSON definitions that need to be written.
void addRecord(const std::string &name, PositionType startPos)
◆ operator=()
◆ writeFrame() [1/2]
void podio::SIOFrameWriter::writeFrame |
( |
const podio::Frame & |
frame, |
|
|
const std::string & |
category |
|
) |
| |
Write the given Frame with the given category
Definition at line 29 of file SIOFrameWriter.cc.
29 {
31}
std::vector< std::string > getAvailableCollections() const
void writeFrame(const podio::Frame &frame, const std::string &category)
Referenced by writeFrame().
◆ writeFrame() [2/2]
void podio::SIOFrameWriter::writeFrame |
( |
const podio::Frame & |
frame, |
|
|
const std::string & |
category, |
|
|
const std::vector< std::string > & |
collsToWrite |
|
) |
| |
Write the given Frame with the given category only storing the collections that are desired via collsToWrite
Definition at line 33 of file SIOFrameWriter.cc.
34 {
35 std::vector<sio_utils::StoreCollection> collections;
36 collections.reserve(collsToWrite.size());
37 for (const auto& name : collsToWrite) {
40 }
41
42
43
44
45 sio::block_list tableBlocks;
48
51}
void registerDatamodelDefinition(const podio::CollectionBase *coll, const std::string &name)
podio::CollectionIDTable getCollectionIDTableForWrite() const
const podio::GenericParameters & getParameters() const
const podio::CollectionBase * getCollectionForWrite(const std::string &name) const
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.
std::shared_ptr< SIOCollectionIDTableBlock > createCollIDBlock(const std::vector< StoreCollection > &collections, const podio::CollectionIDTable &collIdTable)
Create the collection ID block from the passed collections.
The documentation for this class was generated from the following files: