The Gaudi Framework  v30r3 (a5ef0a68)
RecordOutputStream.cpp
Go to the documentation of this file.
1 // Include files
2 
3 // local
4 #include "RecordOutputStream.h"
5 
6 // ----------------------------------------------------------------------------
7 // Implementation file for class: RecordOutputStream
8 //
9 // 30/08/2013: Marco Clemencic
10 // ----------------------------------------------------------------------------
12 
13 // ============================================================================
14 // Initialization
15 // ============================================================================
17 {
18  StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
19  if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
20 
21  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
22 
23  if ( m_streamName.empty() ) {
24  m_streamName = "Deferred:" + name();
25  debug() << "Using default OutputStreamName: '" << m_streamName << "'" << endmsg;
26  }
27 
28  m_flagLocation = locationRoot() + "/" + m_streamName;
29  return StatusCode::SUCCESS;
30 }
31 
32 // ============================================================================
33 // Main execution
34 // ============================================================================
36 {
37  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg;
38 
39  getOrCreate<DataObject, DataObject>( m_flagLocation, false );
40  /*
41  if (!exist(m_flagLocation, false)) {
42  DataObject *obj = new DataObject();
43  put(obj, m_flagLocation, false);
44  }
45  */
46  return StatusCode::SUCCESS;
47 }
48 
49 // ============================================================================
50 // Finalize
51 // ============================================================================
53 {
54  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
55 
56  return GaudiAlgorithm::finalize(); // must be called after all other actions
57 }
58 
59 // ============================================================================
StatusCode initialize() override
standard initialization method
StatusCode execute() override
Algorithm execution.
bool isFailure() const
Definition: StatusCode.h:139
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode finalize() override
standard finalization method
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
StatusCode finalize() override
Algorithm finalization.
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)