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;
42 current_event <<
"\"address\": \"" << jsonEscape(addr) <<
"\"";
44 current_event <<
", \"vars\": {";
46 bool wrote_first_var =
false;
48 for (
const auto& [name, value] : hit->getDoubleVariablesMap()) {
49 if (wrote_first_var) current_event <<
", ";
50 wrote_first_var =
true;
51 current_event <<
"\"" << jsonEscape(name) <<
"\": " << value;
54 for (
const auto& [name, value] : hit->getStringVariablesMap()) {
55 if (wrote_first_var) current_event <<
", ";
56 wrote_first_var =
true;
57 current_event <<
"\"" << jsonEscape(name) <<
"\": \"" << jsonEscape(value) <<
"\"";
67 current_event <<
", \"digitized\": ";
68 current_event <<
"[]";
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
std::string getIdentityString(std::vector< GIdentifier > gidentity)
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.