gstreamer
Loading...
Searching...
No Matches
event.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write the opening and closing delimiters for one event block.
7// Use '\n' instead of std::endl so each line does not force a flush.
8
9bool GstreamerTextFactory::startEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) {
10 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
11
12 auto eventNumber = event_data->getHeader()->getG4LocalEvn();
13 ofile << "Event n. " << eventNumber << " {\n";
14
15 return true;
16}
17
18
19bool GstreamerTextFactory::endEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) {
20 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
21
22 int eventNumber = event_data->getHeader()->getG4LocalEvn();
23
24 ofile << "} end of event " << eventNumber << "\n";
25
26 return true;
27}
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
ASCII streamer plugin declarations.
Shared constants and error codes for the gstreamer module.
#define ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.