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()) {
11 log->error(gstreamer::ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename());
12 }
13
14 auto runId = run_data->getHeader()->getRunID();
15 ofile << "Run number " << runId << " {\n";
16 ofile << guts::GTAB << "Number of events: " << run_data->getHeader()->get_events_processed() << "\n";
17 ofile << guts::GTAB << "Number of events with payload: " << run_data->getHeader()->get_events_with_payload()
18 << "\n";
19
20 return true;
21}
22
23bool GstreamerTextFactory::endRunImpl([[maybe_unused]] const std::shared_ptr<GRunDataCollection>& run_data) {
24 if (!ofile.is_open()) {
25 log->error(gstreamer::ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename());
26 }
27
28 auto runId = run_data->getHeader()->getRunID();
29
30 ofile << "} end of run " << runId << "\n";
31
32 return true;
33}
std::shared_ptr< GLogger > log
ASCII streamer plugin declarations.
Shared constants and error codes for the gstreamer module.
constexpr int ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.
constexpr char GTAB[]