61 bool openConnection()
override;
68 bool closeConnectionImpl()
override;
78 bool startEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
86 bool endEventImpl(
const std::shared_ptr<GEventDataCollection>& event_data)
override;
94 bool publishEventHeaderImpl(
const std::unique_ptr<GEventHeader>& gevent_header)
override;
103 bool publishEventTrueInfoDataImpl(
const std::string& detectorName,
104 const std::vector<const GTrueInfoData*>& trueInfoData)
override;
113 bool publishEventDigitizedDataImpl(
const std::string& detectorName,
114 const std::vector<const GDigitizedData*>& digitizedData)
override;
126 bool publishEventGeneratedParticlesImpl(
const std::string& bankName,
130 bool publishEventAncestorsImpl(
const GAncestorBank& ancestors)
override;
154 bool publishFrameHeaderImpl(
const GFrameHeader* gframeHeader)
override;
162 bool publishPayloadImpl(
const std::vector<GIntegralPayload*>* payload)
override;
169 bool is_file_initialized =
false;
172 bool wrote_first_top_level_entry =
false;
175 std::string top_level_type;
178 bool is_building_event =
false;
181 std::ostringstream current_event;
184 bool current_event_has_header =
false;
187 bool current_event_has_any_detector =
false;
190 bool current_event_has_generated =
false;
195 std::vector<std::string> current_event_digitized_entries;
198 bool is_building_frame =
false;
201 std::ostringstream current_frame;
204 bool current_frame_has_header =
false;
207 bool current_frame_has_payload =
false;
210 std::string timestamp;
213 int event_number = -1;
228 static std::string jsonEscape(
const std::string& s);
229 void ensureFileInitializedForType(
const std::string& type);
230 void writeTopLevelEntry(
const std::string& entry_json);
231 void closeTopLevelObjectIfNeeded();