gstreamer
Loading...
Searching...
No Matches
gSROFactory.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <atomic>
7
15public:
17 static std::shared_ptr<GSROFactory> from_options(const std::shared_ptr<GOptions>& options);
18
19 GSROFactory(std::shared_ptr<GSROImplementation> implementation, std::string output_basename);
20 void begin_run(int run_id, GSROEventId event_count);
24 void interrupt_run() { interrupted = true; }
25 void cancel_run(std::exception_ptr error);
26 void finish_run(bool all_events_processed);
27 void rethrow_if_failed() const;
28 GSROEventContext event_context(GSROEventId event) const { return {run_context.run_id, event}; }
29
30private:
31 // Declaration order keeps implementation code loaded until service/timing/data destruction finishes.
32 std::shared_ptr<GSROImplementation> implementation;
33 GSRORunContext run_context;
34 std::atomic<bool> interrupted{false};
35 GSROService service;
36};
void cancel_run(std::exception_ptr error)
GSROFactory(std::shared_ptr< GSROImplementation > implementation, std::string output_basename)
void rethrow_if_failed() const
void create_crate_thread_if_needed(GSROCrateId crate)
static std::shared_ptr< GSROFactory > from_options(const std::shared_ptr< GOptions > &options)
Return null when SRO is disabled. Load the selected implementation before workers are created.
Definition gSROFactory.cc:6
void finish_run(bool all_events_processed)
void complete_event(GSROEventId event)
void interrupt_run()
Definition gSROFactory.h:24
void begin_run(int run_id, GSROEventId event_count)
GSROEventContext event_context(GSROEventId event) const
Definition gSROFactory.h:28
void dispatch_payload_to_crate(GSROPayload payload)
std::uint32_t GSROCrateId
Definition gSROData.h:18
std::uint64_t GSROEventId
Definition gSROData.h:19
event
Context passed to worker digitizers. Event IDs restart at zero for each run invocation.
Definition gSROData.h:40
One worker-produced contribution, transferred by move to its destination crate.
Definition gSROData.h:58
Upcoming in the next release. Implementation-owned timing and output for one SRO invocation.