ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
loopTest
HiveAlgL1.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 "
HiveAlgL1.h
"
6
#include "GaudiKernel/ServiceHandle.h"
7
#include <thread>
8
#include <chrono>
9
#include <memory>
10
11
HiveAlgL1::HiveAlgL1
(
const
std::string& name,
12
ISvcLocator* pSvcLocator ) :
13
::
HiveAlgBase
( name, pSvcLocator )
14
{}
15
16
HiveAlgL1::~HiveAlgL1
() =
default
;
17
18
StatusCode
HiveAlgL1::initialize
() {
19
ATH_MSG_DEBUG
(
"initialize "
<< name());
20
21
ATH_CHECK
(
m_rdh1
.initialize() );
22
ATH_CHECK
(
m_wrh1
.initialize() );
23
24
return
HiveAlgBase::initialize
();
25
}
26
27
StatusCode
HiveAlgL1::execute
(
const
EventContext& ctx)
const
{
28
29
ATH_MSG_DEBUG
(
"execute "
<< name());
30
31
sleep
(ctx);
32
33
SG::ReadHandle<HiveDataObj>
rdh1{
m_rdh1
, ctx};
34
if
(!rdh1.
isValid
()) {
35
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh1.
key
());
36
return
StatusCode::FAILURE;
37
}
38
39
ATH_MSG_INFO
(
" read: "
<< rdh1.
key
() <<
" = "
<< rdh1->val() );
40
41
SG::WriteHandle<HiveDataObj>
wrh1{
m_wrh1
, ctx};
42
ATH_CHECK
(wrh1.
record
(std::make_unique< HiveDataObj >(rdh1->val()+1)));
43
44
ATH_MSG_INFO
(
" write: "
<< wrh1.
key
() <<
" = "
<< wrh1->val() );
45
46
return
StatusCode::SUCCESS;
47
48
}
49
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
HiveAlgL1.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
HiveAlgL1::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
HiveAlgL1.cxx:27
HiveAlgL1::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition
HiveAlgL1.h:32
HiveAlgL1::initialize
virtual StatusCode initialize() override
Definition
HiveAlgL1.cxx:18
HiveAlgL1::~HiveAlgL1
~HiveAlgL1()
HiveAlgL1::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
HiveAlgL1.h:31
HiveAlgL1::HiveAlgL1
HiveAlgL1(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgL1.cxx:11
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