ATLAS Offline Software
Loading...
Searching...
No Matches
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*/
11
12
13#ifndef ATHCONTAINERS_TOOLS_DVLDATABUCKET_H
14#define ATHCONTAINERS_TOOLS_DVLDATABUCKET_H
15
19#include <memory>
20
21
22
23namespace SG {
24
25
46template <class T>
48 : public SG::DataBucket<T>
49{
50public:
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
149private:
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
Holder to implement conversion copies for DataVector/DataList.
uint32_t CLID
The Class ID type.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Identify view containers to be made persistent.
DVLDataBucket(T *data)
Constructor from a payload object.
DVLDataBucket & operator=(const DVLDataBucket &)
virtual void * cast(CLID clid, IRegisterTransient *irt=0, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
virtual ~DVLDataBucket() override
Destructor.
virtual const CLID & clID() const override
The CLID for the class of object we're holding.
virtual const std::type_info & tinfo() const override
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.
DVLDataBucket()
Default constructor.
DVLDataBucket(std::unique_ptr< U > data)
Constructor from a payload object.
std::pair< DataModel_detail::DVLInfoBase *, void * > ent_t
DVLDataBucket(const DVLDataBucket &other)
Copy constructor.
const std::type_info * m_ti
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.
std::vector< ent_t > vec_t
Interface for registering a transient object in t2p map.
Forward declaration.