ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCsmContByteStreamCnv.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
9#include "GaudiKernel/IRegistry.h"
13
15 AthConstConverter(storageType(), classID(), svcloc, "MdtCsmContByteStreamCnv"), m_tool("Muon::MdtCsmContByteStreamTool") {}
16
18
20
22 ATH_MSG_DEBUG(" initialize ");
23 ATH_CHECK(AthConstConverter::initialize());
24 ATH_CHECK(m_tool.retrieve());
25 return StatusCode::SUCCESS;
26}
27
28StatusCode MdtCsmContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const {
29 MdtCsmContainer* cont = nullptr;
30 SG::fromStorable(pObj, cont);
31 if (!cont) {
32 ATH_MSG_ERROR(" Can not cast to MdtCsmContainer ");
33 return StatusCode::FAILURE;
34 }
35
36 std::string nm = pObj->registry()->name();
37 pAddr = new ByteStreamAddress(classID(), nm, "");
38 return m_tool->convert(cont, msg());
39}
#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)
MsgStream & msg() const
The standard message stream.
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
MdtCsmContByteStreamCnv(ISvcLocator *svcloc)
virtual StatusCode initialize() override
ToolHandle< Muon::IMDT_RDOtoByteStreamTool > m_tool
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
This container provides acces to the MDT RDOs.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)