The Gaudi Framework  v30r3 (a5ef0a68)
Consumer.h
Go to the documentation of this file.
1 #ifndef GAUDI_FUNCTIONAL_CONSUMER_H
2 #define GAUDI_FUNCTIONAL_CONSUMER_H
3 
6 #include "GaudiKernel/apply.h"
7 #include <utility>
8 
9 namespace Gaudi
10 {
11  namespace Functional
12  {
13 
14  template <typename Signature, typename Traits_ = Traits::useDefaults>
15  class Consumer;
16 
17  template <typename... In, typename Traits_>
18  class Consumer<void( const In&... ), Traits_>
20  {
21  public:
22  using details::DataHandleMixin<void, details::filter_evtcontext<In...>, Traits_>::DataHandleMixin;
23 
24  // derived classes are NOT allowed to implement execute ...
25  StatusCode execute() override final
26  {
27  try {
29  } catch ( GaudiException& e ) {
30  ( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
31  return e.code();
32  }
33  return StatusCode::SUCCESS;
34  }
35 
36  // ... instead, they must implement the following operator
37  virtual void operator()( const In&... ) const = 0;
38  };
39  }
40 }
41 
42 #endif
virtual const std::string & message() const
error message to be printed
Define general base for Gaudi exception.
class MergingTransformer< Out(const vector_of_const_< In > void
typename filter_evtcontext_t< In... >::type filter_evtcontext
virtual const StatusCode & code() const
StatusCode for Exception.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
static auto apply(const Algorithm &algo, Handles &handles)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
std::vector< InputHandle_t< In > > m_inputs
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
struct[[deprecated("use MergingTransformer instead")]] Traits_
Helper functions to set/get the application return code.
Definition: __init__.py:1
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209