gstreamer
Loading...
Searching...
No Matches
gstreamerASCIIFactory.h
Go to the documentation of this file.
1#pragma once
2
3// gstreamer
4#include "gstreamer.h"
5
6// c++
7#include <fstream>
8
26{
27public:
30
31 // One instance per thread: forbid copy/move to prevent accidental sharing.
36
37private:
39 bool openConnection() override;
40
42 bool closeConnectionImpl() override;
43
44 // Event stream hooks.
45 bool startEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) override;
46 bool endEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) override;
47 bool publishEventHeaderImpl([[maybe_unused]] const std::unique_ptr<GEventHeader>& gevent_header) override;
48 bool publishEventTrueInfoDataImpl(const std::string& detectorName,
49 const std::vector<const GTrueInfoData*>& trueInfoData) override;
50 bool publishEventDigitizedDataImpl(const std::string& detectorName,
51 const std::vector<const GDigitizedData*>& digitizedData) override;
52
53 // Frame stream hooks.
54 bool startStreamImpl(const GFrameDataCollection* frameRunData) override;
55 bool endStreamImpl(const GFrameDataCollection* frameRunData) override;
56 bool publishFrameHeaderImpl(const GFrameHeader* gframeHeader) override;
57 bool publishPayloadImpl(const std::vector<GIntegralPayload*>* payload) override;
58
60 std::ofstream ofile;
61
63 [[nodiscard]] std::string filename() const override { return gstreamer_definitions.rootname + ".txt"; }
64};
Abstract base class for streaming GEMC event or frame data to output media.
Definition gstreamer.h:66
GStreamer(const std::shared_ptr< GOptions > &g)
Construct a streamer and bind it to module logging.
Definition gstreamer.h:72
GStreamerDefinition gstreamer_definitions
Output definition used by this streamer (format, base name, type, thread id).
Definition gstreamer.h:173
ASCII (human-readable) gstreamer plugin writing event and frame streams to a text file.
GstreamerTextFactory & operator=(GstreamerTextFactory &&)=delete
GstreamerTextFactory(GstreamerTextFactory &&)=delete
GstreamerTextFactory(const GstreamerTextFactory &)=delete
GstreamerTextFactory & operator=(const GstreamerTextFactory &)=delete
Core streaming interface for gstreamer output plugins.
std::string rootname
Base filename (without extension), possibly specialized by thread id.