11bool GstreamerJsonFactory::publishEventTrueInfoDataImpl(
const std::string& detectorName,
12 const std::vector<const GTrueInfoData*>& trueInfoData) {
13 if (!is_building_event) {
19 if (!current_event_has_any_detector) {
20 current_event <<
", \"detectors\": {";
21 current_event_has_any_detector =
true;
23 current_event <<
", ";
26 current_event <<
"\"" << jsonEscape(detectorName) <<
"\": {";
29 current_event <<
"\"true_info\": [";
31 bool wrote_first_hit =
false;
32 for (
const auto* hit : trueInfoData) {
35 if (wrote_first_hit) current_event <<
", ";
36 wrote_first_hit =
true;
40 const std::string addr = hit->getIdentityString();
41 current_event <<
"\"address\": \"" << jsonEscape(addr) <<
"\"";
43 current_event <<
", \"vars\": {";
45 bool wrote_first_var =
false;
47 for (
const auto& [name, value] : hit->getDoubleVariablesMap()) {
48 if (wrote_first_var) current_event <<
", ";
49 wrote_first_var =
true;
50 current_event <<
"\"" << jsonEscape(name) <<
"\": " << value;
53 for (
const auto& [name, value] : hit->getStringVariablesMap()) {
54 if (wrote_first_var) current_event <<
", ";
55 wrote_first_var =
true;
56 current_event <<
"\"" << jsonEscape(name) <<
"\": \"" << jsonEscape(value) <<
"\"";
66 current_event <<
", \"digitized\": ";
67 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
Publish sequence encountered invalid state or invalid input data.
JSON streamer plugin declarations.