| # 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
RecordOutputStream.cpp
Go to the documentation of this file.
1 // Include files
2
3 // From Gaudi
4 #include "GaudiKernel/AlgFactory.h"
5 // local
6 #include "RecordOutputStream.h"
7
8 // ----------------------------------------------------------------------------
9 // Implementation file for class: RecordOutputStream
10 //
11 // 30/08/2013: Marco Clemencic
12 // ----------------------------------------------------------------------------
13 DECLARE_ALGORITHM_FACTORY(RecordOutputStream)
14
15 // ============================================================================
16 // Standard constructor, initializes variables
17 // ============================================================================
18 RecordOutputStream::RecordOutputStream(const std::string& name, ISvcLocator* pSvcLocator)
19 : GaudiAlgorithm(name, pSvcLocator)
20 {
21 declareProperty("OutputStreamName", m_streamName,
22 "Name of the OutputStream instance should be triggered.");
23 }
24
25 // ============================================================================
26 // Destructor
27 // ============================================================================
28 RecordOutputStream::~RecordOutputStream() {}
29
30 // ============================================================================
31 // Initialization
32 // ============================================================================
33 StatusCode RecordOutputStream::initialize() {
34 StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
35 if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
36
37 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Initialize" << endmsg;
38
39 if (m_streamName.empty()) {
40 m_streamName = "Deferred:" + name();
41 debug() << "Using default OutputStreamName: '"
42 << m_streamName << "'" << endmsg;
43 }
44
45 m_flagLocation = locationRoot() + "/" + m_streamName;
46 return StatusCode::SUCCESS;
47 }
48
49 // ============================================================================
50 // Main execution
51 // ============================================================================
52 StatusCode RecordOutputStream::execute() {
53 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Execute" << endmsg;
54
55 getOrCreate<DataObject, DataObject>(m_flagLocation, false);
56 /*
57 if (!exist(m_flagLocation, false)) {
58 DataObject *obj = new DataObject();
59 put(obj, m_flagLocation, false);
60 }
61 */
62 return StatusCode::SUCCESS;
63 }
64
65 // ============================================================================
66 // Finalize
67 // ============================================================================
68 StatusCode RecordOutputStream::finalize() {
69 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Finalize" << endmsg;
70
71 return GaudiAlgorithm::finalize(); // must be called after all other actions
72 }
73
74 // ============================================================================