ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
ByteStreamCnvSvcBase
src
ByteStreamCnvSvcBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
6
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
7
8
#include "GaudiKernel/IOpaqueAddress.h"
9
#include "GaudiKernel/GenericAddress.h"
10
#include "GaudiKernel/IConverter.h"
11
#include "GaudiKernel/ServiceHandle.h"
12
#include "GaudiKernel/IIncidentSvc.h"
13
#include "GaudiKernel/IClassIDSvc.h"
14
15
//______________________________________________________________________________
16
ByteStreamCnvSvcBase::ByteStreamCnvSvcBase
(
const
std::string& name, ISvcLocator* pSvcLocator)
17
: base_class(name, pSvcLocator,
ByteStreamAddress
::storageType()) {}
18
//______________________________________________________________________________
20
ByteStreamCnvSvcBase::~ByteStreamCnvSvcBase
() =
default
;
21
//______________________________________________________________________________
23
StatusCode
ByteStreamCnvSvcBase::initialize
() {
24
ATH_CHECK
(
::AthCnvSvc::initialize
());
25
26
ServiceHandle<IIncidentSvc>
incsvc(
"IncidentSvc"
, this->name());
27
ATH_CHECK
(incsvc.retrieve());
28
incsvc->addListener(
this
,
"BeginRun"
, 0,
false
,
true
);
// true for singleshot
29
return
StatusCode::SUCCESS;
30
}
31
//______________________________________________________________________________
32
StatusCode
ByteStreamCnvSvcBase::updateServiceState
(IOpaqueAddress* pAddress) {
33
if
(pAddress !=
nullptr
) {
34
GenericAddress* pAddr =
dynamic_cast<
GenericAddress*
>
(pAddress);
35
if
(pAddr !=
nullptr
) {
36
return
StatusCode::SUCCESS;
37
}
38
}
39
return
StatusCode::FAILURE;
40
}
41
//______________________________________________________________________________
42
void
ByteStreamCnvSvcBase::handle
(
const
Incident&
/*incident*/
) {
43
ServiceHandle<IClassIDSvc>
clidSvc(
"ClassIDSvc"
, name());
44
if
(!clidSvc.retrieve().isSuccess()) {
45
ATH_MSG_ERROR
(
"Cannot get ClassIDSvc."
);
46
return
;
47
}
48
// Initialize the converters
49
for
(
const
std::string& cnv :
m_initCnvs
.value()) {
50
ATH_MSG_DEBUG
(
"Accessing Converter for "
<< cnv);
51
CLID
id;
52
if
(!clidSvc->getIDOfTypeName(cnv,
id
).isSuccess()) {
53
ATH_MSG_WARNING
(
"Cannot get CLID for "
<< cnv);
54
}
else
{
55
IConverter* cnv = converter(
id
);
56
if
(cnv ==
nullptr
) {
57
ATH_MSG_WARNING
(
"Cannot get converter for "
<< cnv);
58
}
59
}
60
}
61
}
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_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
ByteStreamCnvSvcBase.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
AthCnvSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition
AthCnvSvc.cxx:104
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamCnvSvcBase::initialize
virtual StatusCode initialize() override
Required of all Gaudi Services.
Definition
ByteStreamCnvSvcBase.cxx:23
ByteStreamCnvSvcBase::handle
virtual void handle(const Incident &) override
Implementation of IIncidentListener: Handle for EndEvent incidence.
Definition
ByteStreamCnvSvcBase.cxx:42
ByteStreamCnvSvcBase::ByteStreamCnvSvcBase
ByteStreamCnvSvcBase(const std::string &name, ISvcLocator *pSvcLocator)
Standard Service Constructor.
Definition
ByteStreamCnvSvcBase.cxx:16
ByteStreamCnvSvcBase::updateServiceState
virtual StatusCode updateServiceState(IOpaqueAddress *pAddress) override
Checks whether an IOpaqueAddress is a GenericAddress.
Definition
ByteStreamCnvSvcBase.cxx:32
ByteStreamCnvSvcBase::~ByteStreamCnvSvcBase
virtual ~ByteStreamCnvSvcBase()
Destructor.
ByteStreamCnvSvcBase::m_initCnvs
Gaudi::Property< std::vector< std::string > > m_initCnvs
Definition
ByteStreamCnvSvcBase.h:34
ServiceHandle
Definition
ClusterMakerTool.h:36
Generated on
for ATLAS Offline Software by
1.17.0