gstreamer
Loading...
Searching...
No Matches
publishTrueInfo.cc
Go to the documentation of this file.
1// gstreamer
4
5// using \n instead of endl so flushing isn't forced at each line
6// Non-Doxygen implementation file: behavior is documented in the header.
7bool GstreamerTextFactory::publishEventTrueInfoDataImpl(const std::string& detectorName,
8 const std::vector<const GTrueInfoData*>& trueInfoData) {
9 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
10
11 ofile << GTAB << "Detector <" << detectorName << "> True Info Bank {\n";
12
13 for (auto trueInfoHit : trueInfoData) {
14 std::string identifierString = trueInfoHit->getIdentityString();
15
16 ofile << GTABTAB << "Hit address: " << identifierString << " {\n";
17
18 for (const auto& [variableName, value] : trueInfoHit->getDoubleVariablesMap()) {
19 ofile << GTABTABTAB << variableName << ": " << value << "\n";
20 }
21 for (const auto& [variableName, value] : trueInfoHit->getStringVariablesMap()) {
22 ofile << GTABTABTAB << variableName << ": " << value << "\n";
23 }
24
25 ofile << GTABTAB << "}\n";
26 }
27 ofile << GTAB << "}\n";
28
29 return true;
30}
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Shared constants and error codes for the gstreamer module.
#define ERR_CANTOPENOUTPUT
Output medium could not be opened (file/device not accessible).
#define GTABTABTAB
#define GTAB
#define GTABTAB