gstreamer
Loading...
Searching...
No Matches
gSROImplementation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
gSROCrate.h
"
4
5
#include <gemc/gbase/gbase.h>
6
#include <gemc/gfactory/gdl.h>
7
9
struct
GSRORunContext
{
10
int
run_id
;
11
GSROEventId
event_count
;
12
std::string
output_basename
;
13
};
14
15
struct
GSROConfiguration
{
16
std::shared_ptr<const GSROTiming>
timing
;
17
GSROCrateLimits
crate_limits
;
18
std::size_t
max_pending_events
= 65536;
19
};
20
30
class
GSROImplementation
:
public
GBase
<GSROImplementation> {
31
public
:
32
explicit
GSROImplementation
(
const
std::shared_ptr<GOptions>& opts)
33
:
GBase
(opts,
"gstreamer"
),
options
(opts) {}
34
~GSROImplementation
()
override
=
default
;
35
37
void
set_loggers
(
const
std::shared_ptr<GOptions>& opts) {
38
options
= opts;
39
log
= std::make_shared<GLogger>(opts,
"GSROImplementation"
,
"gstreamer"
);
40
}
41
42
virtual
GSROConfiguration
configure_run
(
const
GSRORunContext
&
run
) = 0;
43
virtual
GSROCrateResources
create_crate
(
GSROCrateId
crate,
const
GSRORunContext
&
run
)
const
= 0;
44
45
static
GSROImplementation
*
instantiate
(
dlhandle
handle,
const
std::shared_ptr<GOptions>& opts) {
46
using
Factory =
GSROImplementation
* (*)(
const
std::shared_ptr<GOptions>&);
47
auto
factory =
reinterpret_cast<
Factory
>
(dlsym(handle,
"GSROImplementationFactory"
));
48
if
(!factory) {
throw
std::runtime_error(
"SRO plugin is missing GSROImplementationFactory"
); }
49
return
factory(opts);
50
}
51
52
protected
:
53
std::shared_ptr<GOptions>
options
;
54
};
GBase< GSROImplementation >::GBase
GBase(const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
GBase< GSROImplementation >::log
std::shared_ptr< GLogger > log
GSROImplementation::instantiate
static GSROImplementation * instantiate(dlhandle handle, const std::shared_ptr< GOptions > &opts)
Definition
gSROImplementation.h:45
GSROImplementation::GSROImplementation
GSROImplementation(const std::shared_ptr< GOptions > &opts)
Definition
gSROImplementation.h:32
GSROImplementation::~GSROImplementation
~GSROImplementation() override=default
GSROImplementation::set_loggers
void set_loggers(const std::shared_ptr< GOptions > &opts)
GManager calls this after loading an implementation, following the standard GEMC plugin contract.
Definition
gSROImplementation.h:37
GSROImplementation::create_crate
virtual GSROCrateResources create_crate(GSROCrateId crate, const GSRORunContext &run) const =0
GSROImplementation::options
std::shared_ptr< GOptions > options
Definition
gSROImplementation.h:53
GSROImplementation::configure_run
virtual GSROConfiguration configure_run(const GSRORunContext &run)=0
gSROCrate.h
GSROCrateId
std::uint32_t GSROCrateId
Definition
gSROData.h:18
GSROEventId
std::uint64_t GSROEventId
Definition
gSROData.h:19
dlhandle
void * dlhandle
run
run
GSROConfiguration
Definition
gSROImplementation.h:15
GSROConfiguration::max_pending_events
std::size_t max_pending_events
Definition
gSROImplementation.h:18
GSROConfiguration::crate_limits
GSROCrateLimits crate_limits
Definition
gSROImplementation.h:17
GSROConfiguration::timing
std::shared_ptr< const GSROTiming > timing
Definition
gSROImplementation.h:16
GSROCrateLimits
Per-crate bounds preventing asynchronous delivery from consuming unlimited memory.
Definition
gSROCrate.h:29
GSROCrateResources
Declare the sink first so the plugin referencing it is destroyed first.
Definition
gSROCrate.h:42
GSRORunContext
Upcoming in the next release. Implementation-owned timing and output for one SRO invocation.
Definition
gSROImplementation.h:9
GSRORunContext::event_count
GSROEventId event_count
Definition
gSROImplementation.h:11
GSRORunContext::output_basename
std::string output_basename
Definition
gSROImplementation.h:12
GSRORunContext::run_id
int run_id
Definition
gSROImplementation.h:10
sro
gSROImplementation.h
Generated by
1.15.0