60 bool openConnection()
override;
67 bool closeConnectionImpl()
override;
77 bool startEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
85 bool endEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
93 bool publishEventHeaderImpl(
const std::unique_ptr<GEventHeader>& gevent_header)
override;
102 bool publishEventTrueInfoDataImpl(
const std::string& detectorName,
103 const std::vector<const GTrueInfoData*>& trueInfoData)
override;
112 bool publishEventDigitizedDataImpl(
const std::string& detectorName,
113 const std::vector<const GDigitizedData*>& digitizedData)
override;
125 bool publishEventGeneratedParticlesImpl(
const std::string& bankName,
150 bool publishFrameHeaderImpl(
const GFrameHeader* gframeHeader)
override;
158 bool publishPayloadImpl(
const std::vector<GIntegralPayload*>* payload)
override;
165 bool is_file_initialized =
false;
168 bool wrote_first_top_level_entry =
false;
171 std::string top_level_type;
174 bool is_building_event =
false;
177 std::ostringstream current_event;
180 bool current_event_has_header =
false;
183 bool current_event_has_any_detector =
false;
186 bool current_event_has_generated =
false;
189 bool is_building_frame =
false;
192 std::ostringstream current_frame;
195 bool current_frame_has_header =
false;
198 bool current_frame_has_payload =
false;
201 std::string timestamp;
204 int event_number = -1;
219 static std::string jsonEscape(
const std::string& s);
220 void ensureFileInitializedForType(
const std::string& type);
221 void writeTopLevelEntry(
const std::string& entry_json);
222 void closeTopLevelObjectIfNeeded();