8bool GstreamerJsonFactory::publishEventTrueInfoDataImpl(
const std::string& detectorName,
9 const std::vector<const GTrueInfoData*>& trueInfoData) {
10 if (!is_building_event) {
16 if (!current_event_has_any_detector) {
17 current_event <<
", \"detectors\": {";
18 current_event_has_any_detector =
true;
24 current_event <<
", ";
28 current_event <<
"\"" << jsonEscape(detectorName) <<
"\": {";
31 current_event <<
"\"true_info\": [";
33 bool wrote_first_hit =
false;
34 for (
const auto* hit : trueInfoData) {
37 if (wrote_first_hit) current_event <<
", ";
38 wrote_first_hit =
true;
43 const std::string addr = hit->getIdentityString();
44 current_event <<
"\"address\": \"" << jsonEscape(addr) <<
"\"";
47 current_event <<
", \"vars\": {";
49 bool wrote_first_var =
false;
52 for (
const auto& [name, value] : hit->getDoubleVariablesMap()) {
53 if (wrote_first_var) current_event <<
", ";
54 wrote_first_var =
true;
55 current_event <<
"\"" << jsonEscape(name) <<
"\": " << value;
59 for (
const auto& [name, value] : hit->getStringVariablesMap()) {
60 if (wrote_first_var) current_event <<
", ";
61 wrote_first_var =
true;
62 current_event <<
"\"" << jsonEscape(name) <<
"\": \"" << jsonEscape(value) <<
"\"";
72 current_event <<
", \"digitized\": ";
80 current_event <<
"[]";
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Shared constants and error codes for the gstreamer module.
#define ERR_PUBLISH_ERROR
Generic publish-time error (null pointers, invalid state).