| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
5 #include "GaudiAlg/GaudiAlgorithm.h"
6 #include "GaudiKernel/HashMap.h"
7 #include "GaudiKernel/SmartIF.h"
8
9 class IAlgManager;
10 class IDataManagerSvc;
11
18 class ReplayOutputStream: public GaudiAlgorithm {
19 public:
21 ReplayOutputStream(const std::string& name, ISvcLocator* pSvcLocator);
22 virtual ~ReplayOutputStream();
23
24 virtual StatusCode initialize();
25 virtual StatusCode start ();
26 virtual StatusCode execute ();
27 virtual StatusCode stop ();
28 virtual StatusCode finalize ();
29
31 typedef GaudiUtils::HashMap<std::string, SmartIF<IAlgorithm> > OutStreamsMapType;
32
33 protected:
34 private:
35
37 void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream);
38
40 class OutStreamAdder {
41 public:
42 OutStreamAdder(ReplayOutputStream *ptr): m_ptr(ptr) {}
43 inline void operator() (const Gaudi::Utils::TypeNameString &outStream) {
44 m_ptr->i_addOutputStream(outStream);
45 }
46 private:
47 ReplayOutputStream *m_ptr;
48 };
49
51 class OutStreamTrigger {
52 public:
53 OutStreamTrigger(ReplayOutputStream *ptr): m_ptr(ptr) {}
54 inline void operator() (const std::string &name) const {
55 SmartIF<IAlgorithm> &alg = m_ptr->m_outputStreams[name];
56 if (alg.isValid()) {
57 if (!alg->isExecuted()) {
58 alg->sysExecute();
59 } else {
60 m_ptr->warning() << name
61 << " already executed for the current event" << endmsg;
62 }
63 } else {
64 m_ptr->warning() << "invalid OuputStream " << name << endmsg;
65 }
66 }
67 private:
68 ReplayOutputStream *m_ptr;
69 };
70
73 template <Gaudi::StateMachine::Transition TR>
74 StatusCode i_outStreamTransition();
75
77 std::vector<std::string> m_outputStreamNames;
79 OutStreamsMapType m_outputStreams;
80
81 SmartIF<IAlgManager> m_algMgr;
82 SmartIF<IDataManagerSvc> m_evtMgr;
83 };
84
85 #endif // COMPONENT_REPLAYOUTPUTSTREAM_H