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"
8 
9 class IAlgManager;
10 class IDataManagerSvc;
11 
19 {
20 public:
23  ~ReplayOutputStream() override = default;
24 
25  StatusCode initialize() override;
26  StatusCode start() override;
27  StatusCode execute() override;
28  StatusCode stop() override;
29  StatusCode finalize() override;
30 
33 
34 private:
36  void i_addOutputStream( const Gaudi::Utils::TypeNameString& outStream );
37 
40  {
41  public:
43  inline void operator()( const Gaudi::Utils::TypeNameString& outStream ) { m_ptr->i_addOutputStream( outStream ); }
44  private:
46  };
47 
50  {
51  public:
53  inline void operator()( const std::string& name ) const
54  {
56  if ( alg ) {
57  if ( !alg->isExecuted() ) {
58  alg->sysExecute();
59  } else {
60  m_ptr->warning() << name << " already executed for the current event" << endmsg;
61  }
62  } else {
63  m_ptr->warning() << "invalid OuputStream " << name << endmsg;
64  }
65  }
66 
67  private:
69  };
70 
73  template <Gaudi::StateMachine::Transition TR>
75 
77  this, "OutputStreams", {}, "OutputStream instances that can be called."};
78 
80  OutStreamsMapType m_outputStreams;
81 
84 };
85 
86 #endif // COMPONENT_REPLAYOUTPUTSTREAM_H
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:725
Implementation of property with value of concrete type.
Definition: Property.h:313
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
virtual StatusCode sysExecute()=0
System execution. This method invokes the execute() method of a concrete algorithm.
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:26
virtual bool isExecuted() const =0
check if the algorithm is already executed for the current event
The useful base class for data processing algorithms.
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:77
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:244