PODIO
v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
ASCIIWriter.cc
Go to the documentation of this file.
1
// podio specific includes
2
#include "
podio/ASCIIWriter.h
"
3
#include "
podio/CollectionBase.h
"
4
#include "
podio/EventStore.h
"
5
6
namespace
podio
{
7
8
ASCIIWriter::ASCIIWriter
(
const
std::string& filename,
EventStore
* store) :
9
m_filename(filename), m_store(store), m_file(new std::ofstream) {
10
11
m_file->open(filename, std::ofstream::binary);
12
}
13
14
ASCIIWriter::~ASCIIWriter
() {
15
delete
m_file;
16
}
17
18
void
ASCIIWriter::writeEvent
() {
19
20
unsigned
i = 0;
21
for
(
auto
& coll : m_storedCollections) {
22
coll->prepareForWrite();
23
24
const
std::string& name = m_collectionNames[i++];
25
std::cout <<
" writing collection "
<< name << std::endl;
26
27
*m_file << name <<
" "
;
28
29
ColWriterBase
* wrt = m_map[name];
30
31
wrt->
writeCollection
(coll, *m_file);
32
}
33
}
34
35
void
ASCIIWriter::finish
() {
36
37
m_file->close();
38
}
39
40
}
// namespace podio
ASCIIWriter.h
CollectionBase.h
EventStore.h
podio::ASCIIWriter::ASCIIWriter
ASCIIWriter(const std::string &filename, EventStore *store)
Definition:
ASCIIWriter.cc:8
podio::ASCIIWriter::writeEvent
void writeEvent()
Definition:
ASCIIWriter.cc:18
podio::ASCIIWriter::finish
void finish()
Definition:
ASCIIWriter.cc:35
podio::ASCIIWriter::~ASCIIWriter
~ASCIIWriter()
Definition:
ASCIIWriter.cc:14
podio::EventStore
Definition:
EventStore.h:37
podio
Definition:
ASCIIWriter.h:14
podio::ColWriterBase
Definition:
ASCIIWriter.h:18
podio::ColWriterBase::writeCollection
virtual void writeCollection(CollectionBase *, std::ostream &)=0
podio-00-16-03
src
ASCIIWriter.cc
Generated by
1.9.6