59 bool openConnection()
override;
66 bool closeConnectionImpl()
override;
76 bool startEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
84 bool endEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
92 bool publishEventHeaderImpl(
const std::unique_ptr<GEventHeader>& gevent_header)
override;
101 bool publishEventTrueInfoDataImpl(
const std::string& detectorName,
102 const std::vector<const GTrueInfoData*>& trueInfoData)
override;
111 bool publishEventDigitizedDataImpl(
const std::string& detectorName,
112 const std::vector<const GDigitizedData*>& digitizedData)
override;
136 bool publishFrameHeaderImpl(
const GFrameHeader* gframeHeader)
override;
144 bool publishPayloadImpl(
const std::vector<GIntegralPayload*>* payload)
override;
151 bool is_file_initialized =
false;
154 bool wrote_first_top_level_entry =
false;
157 std::string top_level_type;
160 bool is_building_event =
false;
163 std::ostringstream current_event;
166 bool current_event_has_header =
false;
169 bool current_event_has_any_detector =
false;
172 bool is_building_frame =
false;
175 std::ostringstream current_frame;
178 bool current_frame_has_header =
false;
181 bool current_frame_has_payload =
false;
184 std::string timestamp;
187 int event_number = -1;
202 static std::string jsonEscape(
const std::string& s);
203 void ensureFileInitializedForType(
const std::string& type);
204 void writeTopLevelEntry(
const std::string& entry_json);
205 void closeTopLevelObjectIfNeeded();