ATLAS Offline Software
Loading...
Searching...
No Matches
JepByteStreamV2Cnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#include <vector>
7
9
12
14
15#include "GaudiKernel/DataObject.h"
16#include "GaudiKernel/IOpaqueAddress.h"
17#include "GaudiKernel/IRegistry.h"
18#include "GaudiKernel/ISvcLocator.h"
19#include "GaudiKernel/StatusCode.h"
20
24
26
27#include "JepByteStreamV2Cnv.h"
28#include "JepByteStreamV2Tool.h"
29
30namespace LVL1BS {
31
33 : AthConstConverter( storageType(), classID(), svcloc, "JepByteStreamV2Cnv" ),
34 m_tool("LVL1BS::JepByteStreamV2Tool/JepByteStreamV2Tool")
35{
36}
37
41
42// CLID
43
48
53
54// Init method gets all necessary services etc.
55
56
58{
59 ATH_CHECK( Converter::initialize() );
60 ATH_CHECK( m_tool.retrieve() );
61
62 return StatusCode::SUCCESS;
63}
64
65// createRep should create the bytestream from RDOs.
66
67StatusCode JepByteStreamV2Cnv::createRepConst ( DataObject* pObj,
68 IOpaqueAddress*& pAddr ) const
69{
71 if( !SG::fromStorable( pObj, jep ) ) {
72 ATH_MSG_ERROR( " Cannot cast to JEPBSCollectionV2" );
73 return StatusCode::FAILURE;
74 }
75
76 const std::string nm = pObj->registry()->name();
77
78 pAddr = new ByteStreamAddress( classID(), nm, "" );
79
80 // Convert to ByteStream
81 return m_tool->convert( jep );
82}
83
84} // end namespace
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
An STL vector of pointers that by default owns its pointed-to elements.
uint32_t CLID
The Class ID type.
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
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()
JepByteStreamV2Cnv(ISvcLocator *svcloc)
ToolHandle< LVL1BS::JepByteStreamV2Tool > m_tool
Tool that does the actual work.
static const CLID & classID()
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Create ByteStream from JEP Container.
virtual StatusCode initialize() override
Jet/Energy Processor container for writing bytestream post-LS1.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)