ATLAS Offline Software
DVLDataBucket.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 */
13 #ifndef ATHCONTAINERS_TOOLS_DVLDATABUCKET_H
14 #define ATHCONTAINERS_TOOLS_DVLDATABUCKET_H
15 
19 #include <memory>
20 
21 
22 
23 namespace SG {
24 
25 
46 template <class T>
48  : public SG::DataBucket<T>
49 {
50 public:
55  m_ti (nullptr),
56  m_clid (CLID_NULL)
57  {}
58 
59 
65 
66 
71  template <class U>
72  DVLDataBucket(std::unique_ptr<U> data);
73 
74 
80 
81 
85  virtual ~DVLDataBucket() override;
86 
87 
96  virtual void* cast (CLID clid, IRegisterTransient* irt = 0,
97  bool isConst = true) override;
98 
99 
108  virtual void* cast (const std::type_info& tinfo,
109  IRegisterTransient* irt = 0,
110  bool isConst = true) override;
111 
112 
125  virtual void* cast (CLID clid,
126  const std::type_info& tinfo,
127  SG::IRegisterTransient* irt = 0,
128  bool isConst = true) override;
129 
130 
137  virtual const CLID& clID() const override;
138 
139 
146  virtual const std::type_info& tinfo() const override;
147 
148 
149 private:
150  typedef std::pair<DataModel_detail::DVLInfoBase*, void*> ent_t;
151  typedef std::vector<ent_t> vec_t;
153 
157  const std::type_info* m_ti;
158 
163 
164  // Avoid coverity warning.
166 };
167 
168 
169 } // namespace SG
170 
171 
173 
174 
175 #endif // not ATHCONTAINERS_TOOLS_DVLDATABUCKET_H
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition: IRegisterTransient.h:28
SG::DVLDataBucket::m_ti
const std::type_info * m_ti
The std::type_info for the class of object we're holding.
Definition: DVLDataBucket.h:157
SG::DVLDataBucket::cast
virtual void * cast(const std::type_info &tinfo, IRegisterTransient *irt=0, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by std::type_info.
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SG::DVLDataBucket::cast
virtual void * cast(CLID clid, IRegisterTransient *irt=0, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::DVLDataBucket::clID
virtual const CLID & clID() const override
The CLID for the class of object we're holding.
SG::DataBucket
Definition: DataBucket.h:30
SG::DVLDataBucket::vec_t
std::vector< ent_t > vec_t
Definition: DVLDataBucket.h:151
SG::DVLDataBucket::DVLDataBucket
DVLDataBucket(T *data)
Constructor from a payload object.
DVLInfo.h
Holder to implement conversion copies for DataVector/DataList.
SG::DVLDataBucket::DVLDataBucket
DVLDataBucket(const DVLDataBucket &other)
Copy constructor.
SG::DVLDataBucket::tinfo
virtual const std::type_info & tinfo() const override
The std::type_info for the class of object we're holding.
DataBucket.h
SG::DVLDataBucket::cast
virtual void * cast(CLID clid, const std::type_info &tinfo, SG::IRegisterTransient *irt=0, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
SG::DVLDataBucket::~DVLDataBucket
virtual ~DVLDataBucket() override
Destructor.
SG::DVLDataBucket::DVLDataBucket
DVLDataBucket()
Default constructor.
Definition: DVLDataBucket.h:54
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::DVLDataBucket::m_copies
vec_t m_copies
Definition: DVLDataBucket.h:152
SG::DVLDataBucket::m_clid
CLID m_clid
The CLID for the class of object we're holding.
Definition: DVLDataBucket.h:162
SG::DVLDataBucket::ent_t
std::pair< DataModel_detail::DVLInfoBase *, void * > ent_t
Definition: DVLDataBucket.h:150
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
SG::DVLDataBucket
A DataBucket specialized for DataVector/DataList.
Definition: DVLDataBucket.h:49
SG::DVLDataBucket::operator=
DVLDataBucket & operator=(const DVLDataBucket &)
SG::DVLDataBucket::DVLDataBucket
DVLDataBucket(std::unique_ptr< U > data)
Constructor from a payload object.
DVLDataBucket.icc
ViewVector.h
Identify view containers to be made persistent.