| The Gaudi Framework v27r1

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

- File List
- File Members

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 // ----------------------------------------------------------------------------
11 DECLARE_ALGORITHM_FACTORY(RecordOutputStream)
12
13 // ============================================================================
14 // Standard constructor, initializes variables
15 // ============================================================================
16 RecordOutputStream::RecordOutputStream(const std::string& name, ISvcLocator* pSvcLocator)
17 : GaudiAlgorithm(name, pSvcLocator)
18 {
19 declareProperty("OutputStreamName", m_streamName,
20 "Name of the OutputStream instance should be triggered.");
21 }
22
23 // ============================================================================
24 // Destructor
25 // ============================================================================
26 RecordOutputStream::~RecordOutputStream() {}
27
28 // ============================================================================
29 // Initialization
30 // ============================================================================
31 StatusCode RecordOutputStream::initialize() {
32 StatusCode sc = GaudiAlgorithm::initialize(); // must be executed first
33 if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
34
35 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Initialize" << endmsg;
36
37 if (m_streamName.empty()) {
38 m_streamName = "Deferred:" + name();
39 debug() << "Using default OutputStreamName: '"
40 << m_streamName << "'" << endmsg;
41 }
42
43 m_flagLocation = locationRoot() + "/" + m_streamName;
44 return StatusCode::SUCCESS;
45 }
46
47 // ============================================================================
48 // Main execution
49 // ============================================================================
50 StatusCode RecordOutputStream::execute() {
51 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Execute" << endmsg;
52
53 getOrCreate<DataObject, DataObject>(m_flagLocation, false);
54 /*
55 if (!exist(m_flagLocation, false)) {
56 DataObject *obj = new DataObject();
57 put(obj, m_flagLocation, false);
58 }
59 */
60 return StatusCode::SUCCESS;
61 }
62
63 // ============================================================================
64 // Finalize
65 // ============================================================================
66 StatusCode RecordOutputStream::finalize() {
67 if ( msgLevel(MSG::DEBUG) ) debug() << "==> Finalize" << endmsg;
68
69 return GaudiAlgorithm::finalize(); // must be called after all other actions
70 }
71
72 // ============================================================================
std::string::empty
T empty(T...args)
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
GaudiAlgorithm::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiAlgorithm.cpp:48
RecordOutputStream::finalize
virtual StatusCode finalize()
Algorithm finalization.
Definition: RecordOutputStream.cpp:66
MSG::DEBUG
Definition: IMessageSvc.h:18
RecordOutputStream::~RecordOutputStream
virtual ~RecordOutputStream()
Destructor.
Definition: RecordOutputStream.cpp:26
std
STL namespace.
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
RecordOutputStream::initialize
virtual StatusCode initialize()
Algorithm initialization.
Definition: RecordOutputStream.cpp:31
RecordOutputStream::m_flagLocation
std::string m_flagLocation
location of the DataObject flag used to record that this algorithm was called
Definition: RecordOutputStream.h:44
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiAlgorithm::finalize
StatusCode finalize() override
standard finalization method
Definition: GaudiAlgorithm.cpp:62
DECLARE_ALGORITHM_FACTORY
#define DECLARE_ALGORITHM_FACTORY(x)
Definition: Algorithm.h:777
GaudiAlgorithm
The useful base class for data processing algorithms.
Definition: GaudiAlgorithm.h:93
RecordOutputStream
Simple class that adds an entry to the Transient Event Store to record that the processing flow trigg...
Definition: RecordOutputStream.h:21
RecordOutputStream.h
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
RecordOutputStream::execute
virtual StatusCode execute()
Algorithm execution.
Definition: RecordOutputStream.cpp:50
RecordOutputStream::m_streamName
std::string m_streamName
Name of the OuputStream that should be called when this algorithm is triggered.
Definition: RecordOutputStream.h:40
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:136
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
RecordOutputStream::locationRoot
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
Definition: RecordOutputStream.h:33