ATLAS Offline Software
Loading...
Searching...
No Matches
BCM_RawContByteStreamCnv.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// BCM_RawContByteStreamCnv.cxx
7// Implementation file for class BCM_RawContByteStreamCnv
10// classID() - returning BCM_RDO_Container ID
11// createRep() - convert BCM_RawData in the container into ByteStream
13// Version 00-00-39 05/03/2007 Daniel Dobos for pixels
15
17
22
25
27// constructor
30 AthConstConverter(storageType(), classID(),svcloc,"BCM_RawContByteStreamCnv"),
32{
33}
34
35// ////////////////////////
36// // destructor
37// ////////////////////////
38// BCM_RawContByteStreamCnv::~BCM_RawContByteStreamCnv() {
39// }
40
42// initialize()
45
46 ATH_CHECK( AthConstConverter::initialize() );
47
48 // retrieve Tool
49 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service("ToolSvc")};
50 ATH_CHECK( toolSvc.isValid() );
51 ATH_CHECK( toolSvc->retrieveTool("BCM_RawContByteStreamTool", m_BCMRawContBSTool) );
52 return StatusCode::SUCCESS;
53}
54
56// classID() - returning BCM_RDO_Container ID
61
65
67// createRep() - convert BCM_RawData in the container into ByteStream
69StatusCode
70BCM_RawContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const
71{
72 BCM_RDO_Container* cont = nullptr;
73 if(! SG::fromStorable(pObj,cont)) {
74 ATH_MSG_ERROR( "Can not cast to BCM_RDO_Container" );
75 return StatusCode::FAILURE;
76 }
77
78 std::string nm = pObj->registry()->name();
79 pAddr = new ByteStreamAddress(classID(),nm,"");
80
81 ATH_CHECK( m_BCMRawContBSTool->convert(cont) );
82
83 return StatusCode::SUCCESS;
84}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(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)
BCM_RawContByteStreamCnv(ISvcLocator *svcloc)
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
BCM_RawContByteStreamTool * m_BCMRawContBSTool
virtual StatusCode initialize() override
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)