The Gaudi Framework
v32r0 (3325bb39)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Consumer.h
Go to the documentation of this file.
1
#ifndef GAUDI_FUNCTIONAL_CONSUMER_H
2
#define GAUDI_FUNCTIONAL_CONSUMER_H
3
4
#include "
GaudiAlg/FunctionalDetails.h
"
5
#include "
GaudiAlg/FunctionalUtilities.h
"
6
#include <utility>
7
8
namespace
Gaudi::Functional
{
9
10
namespace
details
{
11
12
template
<
typename
Signature,
typename
Traits_,
bool
isLegacy>
13
struct
Consumer
;
14
15
template
<
typename
... In,
typename
Traits_
>
16
struct
Consumer
<
void
( const In&... ),
Traits_
,
true
>
17
:
details::DataHandleMixin
<
void
,
details::filter_evtcontext<In...>
,
Traits_
> {
18
using
details::DataHandleMixin
<
void
,
details::filter_evtcontext
<In...>,
Traits_
>
::DataHandleMixin
;
19
20
// derived classes are NOT allowed to implement execute ...
21
StatusCode
execute
() override final {
22
try
{
23
details::filter_evtcontext_t<In...>::apply
( *
this
, this->
m_inputs
);
24
return
StatusCode::SUCCESS
;
25
}
catch
(
GaudiException
& e ) {
26
( e.
code
() ? this->warning() : this->error() ) << e.
message
() <<
endmsg
;
27
return
e.
code
();
28
}
29
}
30
31
// ... instead, they must implement the following operator
32
virtual
void
operator()
(
const
In&... )
const
= 0;
33
};
34
35
template
<
typename
... In,
typename
Traits_
>
36
struct
Consumer
<
void
( const In&... ),
Traits_
,
false
>
37
:
details::DataHandleMixin
<
void
,
details::filter_evtcontext<In...>
,
Traits_
> {
38
using
details::DataHandleMixin
<
void
,
details::filter_evtcontext
<In...>,
Traits_
>
::DataHandleMixin
;
39
40
// derived classes are NOT allowed to implement execute ...
41
StatusCode
execute
(
const
EventContext
& ctx )
const
override
final
{
42
try
{
43
details::filter_evtcontext_t<In...>::apply
( *
this
, ctx, this->
m_inputs
);
44
return
StatusCode::SUCCESS
;
45
}
catch
(
GaudiException
& e ) {
46
( e.
code
() ? this->warning() : this->error() ) << e.
message
() <<
endmsg
;
47
return
e.
code
();
48
}
49
}
50
51
// ... instead, they must implement the following operator
52
virtual
void
operator()
(
const
In&... )
const
= 0;
53
};
54
55
}
// namespace details
56
57
template
<
typename
Signature,
typename
Traits_ = Traits::useDefaults>
58
using
Consumer
=
details::Consumer<Signature, Traits_, details::isLegacy<Traits_>
>;
59
60
}
// namespace Gaudi::Functional
61
62
#endif
GaudiException::message
virtual const std::string & message() const
error message to be printed
Definition:
GaudiException.h:58
GaudiException
Define general base for Gaudi exception.
Definition:
GaudiException.h:21
Gaudi::Functional::details::operator()
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:85
Gaudi::Functional::details::filter_evtcontext
typename filter_evtcontext_t< In... >::type filter_evtcontext
Definition:
FunctionalDetails.h:387
EventContext
This class represents an entry point to all the event specific data.
Definition:
EventContext.h:24
Gaudi::Functional
Definition:
Consumer.h:8
GaudiException::code
virtual const StatusCode & code() const
StatusCode for Exception.
Definition:
GaudiException.h:76
Gaudi::Functional::details::m_inputs
std::vector< InputHandle_t< In > > m_inputs
Definition:
MergingTransformer.h:71
Gaudi::Functional::details::Traits_
class MergingTransformer< Out(const vector_of_const_< In > Traits_
Definition:
MergingTransformer.h:22
Gaudi::Functional::details::DataHandleMixin
Definition:
FunctionalDetails.h:390
details
Definition:
AnyDataWrapper.h:10
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:50
FunctionalUtilities.h
Gaudi::Functional::details::filter_evtcontext_t::apply
static auto apply(const Algorithm &algo, Handles &handles)
Definition:
FunctionalDetails.h:353
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, false >::execute
StatusCode execute(const EventContext &ctx) const override final
Definition:
Consumer.h:41
Gaudi::Functional::details::void
class MergingTransformer< Out(const vector_of_const_< In > void
Definition:
MergingTransformer.h:22
Gaudi::Functional::details::Consumer< void(const In &...), Traits_, true >::execute
StatusCode execute() override final
Definition:
Consumer.h:21
Gaudi::Functional::details::Consumer
Definition:
Consumer.h:13
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition:
MsgStream.h:192
FunctionalDetails.h
GaudiAlg
GaudiAlg
Consumer.h
Generated on Sat May 18 2019 11:01:34 for The Gaudi Framework by
1.8.11