ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
HiveAlgD.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
HiveAlgD.h
"
6
7
HiveAlgD::HiveAlgD
(
const
std::string& name,
8
ISvcLocator* pSvcLocator ) :
9
::
HiveAlgBase
( name, pSvcLocator )
10
{
11
}
12
13
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14
HiveAlgD::~HiveAlgD
() =
default
;
15
16
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17
StatusCode
HiveAlgD::initialize
() {
18
ATH_MSG_DEBUG
(
"initialize "
<< name());
19
20
ATH_CHECK
(
m_rdh1
.initialize() );
21
ATH_CHECK
(
m_wrh1
.initialize() );
22
23
// initialize base class
24
return
HiveAlgBase::initialize
();
25
}
26
27
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
StatusCode
HiveAlgD::execute
(
const
EventContext& ctx)
const
{
29
30
ATH_MSG_DEBUG
(
"execute "
<< name());
31
32
sleep
(ctx);
33
34
SG::ReadHandle<HiveDataObj>
rdh1{
m_rdh1
, ctx};
35
if
(!rdh1.
isValid
()) {
36
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh1.
key
());
37
return
StatusCode::FAILURE;
38
}
39
40
ATH_MSG_INFO
(
" read: "
<< rdh1.
key
() <<
" = "
<< rdh1->val() );
41
42
SG::WriteHandle<HiveDataObj>
wrh1{
m_wrh1
, ctx};
43
ATH_CHECK
(wrh1.
record
(std::make_unique< HiveDataObj >(40000)));
44
45
ATH_MSG_INFO
(
" write: "
<< wrh1.
key
() <<
" = "
<< wrh1->val() );
46
47
return
StatusCode::SUCCESS;
48
49
}
50
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
HiveAlgD.h
Simple Algorithm that reads one HiveDataObj created by HiveAlgA, and writes out one object.
HiveAlgBase::HiveAlgBase
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgBase.cxx:12
HiveAlgBase::sleep
unsigned int sleep(const EventContext &ctx) const
Definition
HiveAlgBase.cxx:40
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition
HiveAlgBase.cxx:23
HiveAlgD::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
HiveAlgD.h:38
HiveAlgD::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
HiveAlgD.cxx:28
HiveAlgD::initialize
virtual StatusCode initialize() override
Definition
HiveAlgD.cxx:17
HiveAlgD::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition
HiveAlgD.h:40
HiveAlgD::~HiveAlgD
~HiveAlgD()
HiveAlgD::HiveAlgD
HiveAlgD(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgD.cxx:7
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Generated on
for ATLAS Offline Software by
1.17.0