gstreamer
Loading...
Searching...
No Matches
run.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write the opening and closing delimiters for one run block.
7// Use '\n' instead of std::endl so each line does not force a flush.
8
9bool GstreamerTextFactory::startRunImpl([[maybe_unused]] const std::shared_ptr<GRunDataCollection>& run_data) {
10 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
11
12 auto runId = run_data->getHeader()->getRunID();
13 ofile << "Run number " << runId << " {\n";
14 ofile << GTAB << "Number of events: " << run_data->getHeader()->get_events_processed() << "\n";
15 ofile << GTAB << "Number of events with payload: " << run_data->getHeader()->get_events_with_payload() << "\n";
16
17 return true;
18}
19
20bool GstreamerTextFactory::endRunImpl([[maybe_unused]] const std::shared_ptr<GRunDataCollection>& run_data) {
21 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
22
23 auto runId = run_data->getHeader()->getRunID();
24
25 ofile << "} end of run " << runId << "\n";
26
27 return true;
28}
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.
#define GTAB