gstreamer
Loading...
Searching...
No Matches
GstreamerJsonFactory Class Reference

JSON plugin writing structured event or frame output into a single JSON document. More...

#include <gstreamerJSONFactory.h>

Public Member Functions

 GstreamerJsonFactory (const GstreamerJsonFactory &)=delete
 
GstreamerJsonFactoryoperator= (const GstreamerJsonFactory &)=delete
 
 GstreamerJsonFactory (GstreamerJsonFactory &&)=delete
 
GstreamerJsonFactoryoperator= (GstreamerJsonFactory &&)=delete
 
 GStreamer (const std::shared_ptr< GOptions > &g)
 Inherit the constructor taking the parsed options container.
 
- Public Member Functions inherited from GStreamer
 GStreamer (const std::shared_ptr< GOptions > &g)
 Construct the streamer base and initialize module logging.
 
virtual ~GStreamer ()=default
 Virtual destructor.
 
bool closeConnection ()
 Close the output medium after flushing buffered events.
 
void publishEventData (const std::shared_ptr< GEventDataCollection > &event_data)
 Queue one event for publication.
 
void publishRunData (const std::shared_ptr< GRunDataCollection > &run_data)
 Publish one run-level data collection immediately.
 
std::string getStreamType () const
 Return the semantic stream type associated with this streamer instance.
 
void define_gstreamer (const GStreamerDefinition &gstreamerDefinition, int tid=-1)
 Assign the output definition used by this streamer instance.
 
void set_loggers (const std::shared_ptr< GOptions > &g)
 Load streamer runtime settings from the parsed options container.
 
- Public Member Functions inherited from GBase< GStreamer >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Static Public Member Functions inherited from GStreamer
static const std::vector< std::string > & supported_formats ()
 Return the list of output format tokens supported by the module.
 
static bool is_valid_format (const std::string &format)
 Validate whether a format token is supported.
 
static GStreamerinstantiate (const dlhandle h, std::shared_ptr< GOptions > g)
 Instantiate a streamer plugin from a dynamic library handle.
 
- Protected Member Functions inherited from GStreamer
bool startEvent (const std::shared_ptr< GEventDataCollection > &event_data)
 Begin publishing one buffered event.
 
bool endEvent (const std::shared_ptr< GEventDataCollection > &event_data)
 End publishing one buffered event.
 
bool publishEventHeader (const std::unique_ptr< GEventHeader > &gevent_header)
 Publish the event header for the current event sequence.
 
bool publishEventTrueInfoData (const std::string &detectorName, const std::vector< const GTrueInfoData * > &trueInfoData)
 Publish the true-information hit bank for one detector.
 
bool publishEventDigitizedData (const std::string &detectorName, const std::vector< const GDigitizedData * > &digitizedData)
 Publish the digitized hit bank for one detector.
 
bool startRun (const std::shared_ptr< GRunDataCollection > &run_data)
 Begin publishing one run-level collection.
 
virtual bool startRunImpl (const std::shared_ptr< GRunDataCollection > &run_data)
 Plugin-specific implementation hook called at the start of a run publish sequence.
 
bool endRun (const std::shared_ptr< GRunDataCollection > &run_data)
 End publishing one run-level collection.
 
virtual bool endRunImpl (const std::shared_ptr< GRunDataCollection > &run_data)
 Plugin-specific implementation hook called at the end of a run publish sequence.
 
bool publishRunHeader (const std::unique_ptr< GRunHeader > &run_header)
 Publish the run header for the current run sequence.
 
virtual bool publishRunHeaderImpl (const std::unique_ptr< GRunHeader > &run_header)
 Plugin-specific implementation hook for serializing one run header.
 
bool publishRunDigitizedData (const std::string &detectorName, const std::vector< const GDigitizedData * > &digitizedData)
 Publish run-level digitized data for one detector.
 
virtual bool publishRunDigitizedDataImpl (const std::string &detectorName, const std::vector< const GDigitizedData * > &digitizedData)
 Plugin-specific implementation hook for one detector run-level digitized collection.
 
bool startStream (const GFrameDataCollection *frameRunData)
 Begin publishing one frame stream record.
 
bool publishFrameHeader (const GFrameHeader *gframeHeader)
 Publish one frame header.
 
bool publishPayload (const std::vector< GIntegralPayload * > *payload)
 Publish one frame payload.
 
bool endStream (const GFrameDataCollection *frameRunData)
 End publishing one frame stream record.
 
void flushEventBuffer ()
 Flush all buffered events to the backend in publish order.
 
- Protected Attributes inherited from GStreamer
GStreamerDefinition gstreamer_definitions
 Output definition currently bound to this streamer instance.
 
- Protected Attributes inherited from GBase< GStreamer >
std::shared_ptr< GLoggerlog
 

Detailed Description

The plugin writes one top-level JSON object per output file. Depending on the active stream type, the document contains either:

  • an "events" array
  • or a "frames" array

Event objects are assembled incrementally following the publish sequence driven by the base class. This allows the plugin to receive event header, detector true-information, and detector digitized content in a well-defined order and serialize them into one structured JSON entry.

The plugin performs lightweight JSON escaping internally and intentionally avoids introducing an external JSON dependency.

Threading model:

  • one instance per worker thread is the intended usage
  • copy and move are disabled to prevent accidental sharing of stream and assembly state

Definition at line 40 of file gstreamerJSONFactory.h.

Constructor & Destructor Documentation

◆ GstreamerJsonFactory() [1/2]

GstreamerJsonFactory::GstreamerJsonFactory ( const GstreamerJsonFactory & )
delete

◆ GstreamerJsonFactory() [2/2]

GstreamerJsonFactory::GstreamerJsonFactory ( GstreamerJsonFactory && )
delete

Member Function Documentation

◆ GStreamer()

GStreamer::GStreamer ( const std::shared_ptr< GOptions > & g)
inlineexplicit

Definition at line 84 of file gstreamer.h.

◆ operator=() [1/2]

GstreamerJsonFactory & GstreamerJsonFactory::operator= ( const GstreamerJsonFactory & )
delete

◆ operator=() [2/2]

GstreamerJsonFactory & GstreamerJsonFactory::operator= ( GstreamerJsonFactory && )
delete

The documentation for this class was generated from the following files: