ATLAS Offline Software
Loading...
Searching...
No Matches
RpcPadContByteStreamCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <string>
8
11#include "GaudiKernel/IRegistry.h"
14
16 AthConstConverter(storageType(), classID(), svcloc, "RpcPadContByteStreamCnv"), m_tool("Muon::RpcPadContByteStreamTool") {}
17
19
21
23 ATH_MSG_DEBUG(" initialize ");
24 ATH_CHECK(AthConstConverter::initialize());
25 ATH_CHECK(m_tool.retrieve());
26 return StatusCode::SUCCESS;
27}
28
29StatusCode RpcPadContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const {
30 RpcPadContainer* cont = nullptr;
31 SG::fromStorable(pObj, cont);
32 if (!cont) {
33 ATH_MSG_ERROR(" Can not cast to RpcPadContainer ");
34 return StatusCode::FAILURE;
35 }
36
37 std::string nm = pObj->registry()->name();
38 pAddr = new ByteStreamAddress(classID(), nm, "");
39 return m_tool->convert(cont);
40}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
uint32_t CLID
The Class ID type.
convert to and from a SG storable
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
RpcPadContByteStreamCnv(ISvcLocator *svcloc)
ToolHandle< Muon::IRPC_RDOtoByteStreamTool > m_tool
virtual StatusCode initialize() override
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Use IdentifiableContainer with RpcPad.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)