PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
SIOWriter.h
Go to the documentation of this file.
1#ifndef PODIO_SIOWRITER_H
2#define PODIO_SIOWRITER_H
3
5#include "podio/EventStore.h"
6#include "podio/SIOBlock.h"
8
9// SIO specific includes
10#include <sio/definitions.h>
11
12#include <iostream>
13#include <string>
14#include <vector>
15
16// forward declarations
17
18namespace podio {
20
21public:
22 SIOWriter(const std::string& filename, EventStore* store);
23 ~SIOWriter() = default;
24
25 // non-copyable
26 SIOWriter(const SIOWriter&) = delete;
27 SIOWriter& operator=(const SIOWriter&) = delete;
28
29 void registerForWrite(const std::string& name);
30 void writeEvent();
31 void finish();
32
33private:
34 void writeCollectionIDTable();
35 sio::block_list createBlocks() const;
36
37 // members
38 std::string m_filename{};
39 EventStore* m_store = nullptr;
40
41 std::shared_ptr<SIOEventMetaDataBlock> m_eventMetaData;
42 sio::ofstream m_stream{};
43 bool m_firstEvent{true};
44
45 std::shared_ptr<SIONumberedMetaDataBlock> m_runMetaData;
46 std::shared_ptr<SIONumberedMetaDataBlock> m_collectionMetaData;
47 SIOFileTOCRecord m_tocRecord{};
48 std::vector<std::string> m_collectionsToWrite{};
49};
50
51} // namespace podio
52#endif
#define DEPR_EVTSTORE
Definition: Deprecated.h:4
SIOWriter & operator=(const SIOWriter &)=delete
SIOWriter(const SIOWriter &)=delete
~SIOWriter()=default