ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
loopTest
HiveAlgL2.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 "
HiveAlgL2.h
"
6
#include "GaudiKernel/ServiceHandle.h"
7
#include <thread>
8
#include <chrono>
9
#include <memory>
10
11
HiveAlgL2::HiveAlgL2
(
const
std::string& name,
12
ISvcLocator* pSvcLocator ) :
13
::
HiveAlgBase
( name, pSvcLocator )
14
{
15
}
16
17
HiveAlgL2::~HiveAlgL2
() =
default
;
18
19
StatusCode
HiveAlgL2::initialize
() {
20
ATH_MSG_DEBUG
(
"initialize "
<< name());
21
22
ATH_CHECK
(
m_rdh1
.initialize() );
23
ATH_CHECK
(
m_udh1
.initialize() );
24
25
return
HiveAlgBase::initialize
();
26
}
27
28
StatusCode
HiveAlgL2::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::UpdateHandle<HiveDataObj>
udh1{
m_udh1
, ctx};
43
44
udh1->val( udh1->val() + 1);
45
46
ATH_MSG_INFO
(
" update: "
<< udh1.
key
() <<
" = "
<< udh1->val() );
47
48
return
StatusCode::SUCCESS;
49
50
}
51
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
HiveAlgL2.h
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
HiveAlgL2::HiveAlgL2
HiveAlgL2(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgL2.cxx:11
HiveAlgL2::m_udh1
SG::UpdateHandleKey< HiveDataObj > m_udh1
Definition
HiveAlgL2.h:30
HiveAlgL2::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
HiveAlgL2.cxx:28
HiveAlgL2::~HiveAlgL2
~HiveAlgL2()
HiveAlgL2::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
HiveAlgL2.h:29
HiveAlgL2::initialize
virtual StatusCode initialize() override
Definition
HiveAlgL2.cxx:19
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::UpdateHandle
Definition
UpdateHandle.h:91
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
Generated on
for ATLAS Offline Software by
1.17.0