70 bool openConnection()
override;
80 bool closeConnectionImpl()
override;
91 bool startEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
99 bool endEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
107 bool publishEventHeaderImpl(
const std::unique_ptr<GEventHeader>& gevent_header)
override;
116 bool publishEventTrueInfoDataImpl(
const std::string& detectorName,
117 const std::vector<const GTrueInfoData*>& trueInfoData)
override;
126 bool publishEventDigitizedDataImpl(
const std::string& detectorName,
127 const std::vector<const GDigitizedData*>& digitizedData)
override;
153 bool publishFrameHeaderImpl(
const GFrameHeader* gframeHeader)
override;
160 bool publishPayloadImpl(
const std::vector<GIntegralPayload*>* payload)
override;
167 bool is_file_initialized =
false;
170 bool wrote_first_top_level_entry =
false;
173 std::string top_level_type;
176 bool is_building_event =
false;
177 std::ostringstream current_event;
178 bool current_event_has_header =
false;
179 bool current_event_has_any_detector =
false;
182 bool is_building_frame =
false;
183 std::ostringstream current_frame;
184 bool current_frame_has_header =
false;
185 bool current_frame_has_payload =
false;
188 std::string timestamp;
189 int event_number = -1;
197 static std::string jsonEscape(
const std::string& s);
198 void ensureFileInitializedForType(
const std::string& type);
199 void writeTopLevelEntry(
const std::string& entry_json);
200 void closeTopLevelObjectIfNeeded();