Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RecordOutputStream.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Include files
12 
13 // local
14 #include "RecordOutputStream.h"
15 
16 // ----------------------------------------------------------------------------
17 // Implementation file for class: RecordOutputStream
18 //
19 // 30/08/2013: Marco Clemencic
20 // ----------------------------------------------------------------------------
22 
23 // ============================================================================
24 // Initialization
25 // ============================================================================
27  StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
28  if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
29 
30  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
31 
32  if ( m_streamName.empty() ) {
33  m_streamName = "Deferred:" + name();
34  debug() << "Using default OutputStreamName: '" << m_streamName << "'" << endmsg;
35  }
36 
37  m_flagLocation = locationRoot() + "/" + m_streamName;
38  return StatusCode::SUCCESS;
39 }
40 
41 // ============================================================================
42 // Main execution
43 // ============================================================================
45  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg;
46 
47  getOrCreate<DataObject, DataObject>( m_flagLocation, false );
48  /*
49  if (!exist(m_flagLocation, false)) {
50  DataObject *obj = new DataObject();
51  put(obj, m_flagLocation, false);
52  }
53  */
54  return StatusCode::SUCCESS;
55 }
56 
57 // ============================================================================
58 // Finalize
59 // ============================================================================
61  if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
62 
63  return GaudiAlgorithm::finalize(); // must be called after all other actions
64 }
65 
66 // ============================================================================
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
RecordOutputStream::m_flagLocation
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
Definition: RecordOutputStream.h:48
GaudiAlgorithm::finalize
StatusCode finalize() override
standard finalization method
Definition: GaudiAlgorithm.cpp:65
RecordOutputStream::execute
StatusCode execute() override
Algorithm execution.
Definition: RecordOutputStream.cpp:44
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:148
TimingHistograms.name
name
Definition: TimingHistograms.py:25
StatusCode
Definition: StatusCode.h:65
RecordOutputStream::finalize
StatusCode finalize() override
Algorithm finalization.
Definition: RecordOutputStream.cpp:60
GaudiAlgorithm::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiAlgorithm.cpp:52
RecordOutputStream
Definition: RecordOutputStream.h:30
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
RecordOutputStream.h