ATLAS Offline Software
HLTResultMTByteStreamCnv.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGHLTRESULTBYTESTREAM_HLTResultMTByteStreamCnv_H
6 #define TRIGHLTRESULTBYTESTREAM_HLTResultMTByteStreamCnv_H
7 
8 // Athena includes
13 
14 // Gaudi includes
15 #include "GaudiKernel/Converter.h"
16 
17 namespace HLT {
22  public:
24  HLTResultMTByteStreamCnv(ISvcLocator* svcLoc);
26  virtual ~HLTResultMTByteStreamCnv();
27 
28  // ------------------------- Converter methods -----------------------------
29  virtual StatusCode initialize() override;
30  virtual StatusCode finalize() override;
31 
33  virtual StatusCode createObj(IOpaqueAddress* pAddr, DataObject*& pObj) override;
35  virtual StatusCode createRep(DataObject* pObj, IOpaqueAddress*& pAddr) override;
36 
37  // ------------------------- Converter definition helpers ------------------
39  static long storageType();
41  static const CLID& classID();
42 
43  long repSvcType() const override { return i_repSvcType(); }
44 
45  private:
48 
51  struct Cache {
52  std::unique_ptr<uint32_t[]> streamTagData;
53  std::vector<std::unique_ptr<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment>> robFragments;
54  ~Cache() {clear();}
55  void clear() {
56  streamTagData.reset();
57  for (auto& ptr : robFragments) ptr.reset();
58  robFragments.clear();
59  }
60  };
62  };
63 } // namespace HLT
64 
65 #endif // TRIGHLTRESULTBYTESTREAM_HLTResultMTByteStreamCnv_H
HLT::HLTResultMTByteStreamCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr) override
Create ByteStream from RDO (HLTResultMT)
Definition: HLTResultMTByteStreamCnv.cxx:94
HLT::HLTResultMTByteStreamCnv::Cache::~Cache
~Cache()
Definition: HLTResultMTByteStreamCnv.h:54
HLT::HLTResultMTByteStreamCnv::m_ByteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Helper to obtain the RawEvent pointer.
Definition: HLTResultMTByteStreamCnv.h:47
IByteStreamEventAccess.h
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
HLT::HLTResultMTByteStreamCnv::Cache::robFragments
std::vector< std::unique_ptr< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment > > robFragments
Definition: HLTResultMTByteStreamCnv.h:53
HLT::HLTResultMTByteStreamCnv
ByteStream converter for HLTResultMT.
Definition: HLTResultMTByteStreamCnv.h:21
HLT::HLTResultMTByteStreamCnv::Cache::streamTagData
std::unique_ptr< uint32_t[]> streamTagData
Definition: HLTResultMTByteStreamCnv.h:52
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
HLT::HLTResultMTByteStreamCnv::storageType
static long storageType()
Storage type used by this converter.
Definition: HLTResultMTByteStreamCnv.cxx:257
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
HLT::HLTResultMTByteStreamCnv::Cache
Cache tracking memory allocation for serialised stream tag data and ROBFragment objects.
Definition: HLTResultMTByteStreamCnv.h:51
HLT::HLTResultMTByteStreamCnv::Cache::clear
void clear()
Definition: HLTResultMTByteStreamCnv.h:55
Converter
Definition: Converter.h:27
HLT::HLTResultMTByteStreamCnv::m_cache
SG::SlotSpecificObj< Cache > m_cache
Definition: HLTResultMTByteStreamCnv.h:61
HLT::HLTResultMTByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: HLTResultMTByteStreamCnv.cxx:64
HLT::HLTResultMTByteStreamCnv::repSvcType
long repSvcType() const override
return repSvcType
Definition: HLTResultMTByteStreamCnv.h:43
AthMessaging.h
SlotSpecificObj.h
Maintain a set of objects, one per slot.
HLT::HLTResultMTByteStreamCnv::classID
static const CLID & classID()
CLID of the class HLTResultMT converted by this converter.
Definition: HLTResultMTByteStreamCnv.cxx:253
HLT::HLTResultMTByteStreamCnv::HLTResultMTByteStreamCnv
HLTResultMTByteStreamCnv(ISvcLocator *svcLoc)
Standard constructor.
Definition: HLTResultMTByteStreamCnv.cxx:51
HLT::HLTResultMTByteStreamCnv::~HLTResultMTByteStreamCnv
virtual ~HLTResultMTByteStreamCnv()
Standard destructor.
Definition: HLTResultMTByteStreamCnv.cxx:59
HLT::HLTResultMTByteStreamCnv::finalize
virtual StatusCode finalize() override
Definition: HLTResultMTByteStreamCnv.cxx:74
HLT::HLTResultMTByteStreamCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Create RDO (HLTResultMT) from ByteStream.
Definition: HLTResultMTByteStreamCnv.cxx:85
ServiceHandle< IByteStreamEventAccess >