gstreamer
Loading...
Searching...
No Matches
gSROFactory.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
gemc/gstreamer/sro/gSROImplementation.h
>
4
#include <
gemc/gstreamer/sro/gSROService.h
>
5
6
#include <atomic>
7
14
class
GSROFactory
{
15
public
:
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);
21
void
create_crate_thread_if_needed
(
GSROCrateId
crate);
22
void
dispatch_payload_to_crate
(
GSROPayload
payload);
23
void
complete_event
(
GSROEventId
event
);
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
30
private
:
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
};
GSROFactory::cancel_run
void cancel_run(std::exception_ptr error)
Definition
gSROFactory.cc:42
GSROFactory::GSROFactory
GSROFactory(std::shared_ptr< GSROImplementation > implementation, std::string output_basename)
Definition
gSROFactory.cc:20
GSROFactory::rethrow_if_failed
void rethrow_if_failed() const
Definition
gSROFactory.cc:51
GSROFactory::create_crate_thread_if_needed
void create_crate_thread_if_needed(GSROCrateId crate)
Definition
gSROFactory.cc:35
GSROFactory::from_options
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
GSROFactory::finish_run
void finish_run(bool all_events_processed)
Definition
gSROFactory.cc:46
GSROFactory::complete_event
void complete_event(GSROEventId event)
Definition
gSROFactory.cc:41
GSROFactory::interrupt_run
void interrupt_run()
Definition
gSROFactory.h:24
GSROFactory::begin_run
void begin_run(int run_id, GSROEventId event_count)
Definition
gSROFactory.cc:25
GSROFactory::event_context
GSROEventContext event_context(GSROEventId event) const
Definition
gSROFactory.h:28
GSROFactory::dispatch_payload_to_crate
void dispatch_payload_to_crate(GSROPayload payload)
Definition
gSROFactory.cc:38
GSROCrateId
std::uint32_t GSROCrateId
Definition
gSROData.h:18
GSROEventId
std::uint64_t GSROEventId
Definition
gSROData.h:19
gSROImplementation.h
gSROService.h
event
event
GSROEventContext
Context passed to worker digitizers. Event IDs restart at zero for each run invocation.
Definition
gSROData.h:40
GSROPayload
One worker-produced contribution, transferred by move to its destination crate.
Definition
gSROData.h:58
GSRORunContext
Upcoming in the next release. Implementation-owned timing and output for one SRO invocation.
Definition
gSROImplementation.h:9
factories
SRO
gSROFactory.h
Generated by
1.15.0