The Gaudi Framework  v29r0 (ff2e7097)
ReplayOutputStream.h
Go to the documentation of this file.
1 #ifndef COMPONENT_REPLAYOUTPUTSTREAM_H
2 #define COMPONENT_REPLAYOUTPUTSTREAM_H 1
3 // Include files
4 // from Gaudi
6 #include "GaudiKernel/HashMap.h"
7 #include "GaudiKernel/SmartIF.h"
9 
10 class IAlgManager;
11 class IDataManagerSvc;
12 
20 {
21 public:
24  ~ReplayOutputStream() override = default;
25 
26  StatusCode initialize() override;
27  StatusCode start() override;
28  StatusCode execute() override;
29  StatusCode stop() override;
30  StatusCode finalize() override;
31 
34 
35 private:
37  void i_addOutputStream( const Gaudi::Utils::TypeNameString& outStream );
38 
41  {
42  public:
44  inline void operator()( const Gaudi::Utils::TypeNameString& outStream ) { m_ptr->i_addOutputStream( outStream ); }
45 
46  private:
48  };
49 
52  {
53  public:
55  inline void operator()( const std::string& name ) const
56  {
58  if ( alg ) {
59  if ( !alg->isExecuted() ) {
61  } else {
62  m_ptr->warning() << name << " already executed for the current event" << endmsg;
63  }
64  } else {
65  m_ptr->warning() << "invalid OuputStream " << name << endmsg;
66  }
67  }
68 
69  private:
71  };
72 
75  template <Gaudi::StateMachine::Transition TR>
77 
79  this, "OutputStreams", {}, "OutputStream instances that can be called."};
80 
82  OutStreamsMapType m_outputStreams;
83 
86 };
87 
88 #endif // COMPONENT_REPLAYOUTPUTSTREAM_H
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:731
Implementation of property with value of concrete type.
Definition: Property.h:319
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
Helper class to call the required OutputStream.
StatusCode finalize() override
Algorithm finalization.
~ReplayOutputStream() override=default
Destructor.
Header file for class GaudiAlgorithm.
OutStreamTrigger(ReplayOutputStream *ptr)
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
STL class.
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
Helper class to parse a string of format "type/name".
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode stop() override
Algorithm finalization.
Gaudi::Property< std::vector< std::string > > m_outputStreamNames
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
virtual bool isExecuted() const =0
check if the algorithm is already executed for the current event
The useful base class for data processing algorithms.
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
GAUDI_API const EventContext & currentContext()
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
Helper class to fill the internal map of OutputStreams.
StatusCode execute() override
Algorithm execution.
StatusCode start() override
Algorithm initialization.
GaudiUtils::HashMap< std::string, SmartIF< IAlgorithm > > OutStreamsMapType
Class used to hold the OutputStream instances.
void operator()(const std::string &name) const
Common class providing an architecture-independent hash map.
Definition: HashMap.h:74
StatusCode initialize() override
Algorithm initialization.
void operator()(const Gaudi::Utils::TypeNameString &outStream)
SmartIF< IDataManagerSvc > m_evtMgr
OutStreamAdder(ReplayOutputStream *ptr)
SmartIF< IAlgManager > m_algMgr
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209