Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PackedLinkVector.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-2024 CERN for the benefit of the ATLAS collaboration.
4  */
13 #ifndef ATHCONTAINERS_PACKEDLINKVECTOR_H
14 #define ATHCONTAINERS_PACKEDLINKVECTOR_H
15 
16 
21 #include "AthLinks/ElementLink.h"
22 #include "AthLinks/DataLink.h"
23 #include <ranges>
24 
25 
26 namespace SG {
27 
28 
39 template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
41  : public AuxTypeVectorHolder<PackedLink<CONT>,
42  typename AuxDataTraits<PackedLink<CONT>, ALLOC>::vector_type>
43 {
46 
47 
48 public:
50  using Base::Base;
51  using vector_type = typename Base::vector_type;
52  using element_type = typename Base::element_type;
53 
54 
57 
58 
67  vector_type* vecPtr,
68  IAuxTypeVector* linkedVec,
69  bool ownFlag);
70 
71 
94  virtual bool insertMove (size_t pos,
95  void* src, size_t src_pos, size_t src_n,
96  IAuxStore& srcStore) override;
97 
98 
99 protected:
102 };
103 
104 
105 //**************************************************************************
106 
107 
120 template <class CONT,
121  class VALLOC = AuxAllocator_t<PackedLink<CONT> >,
122  class VELT = typename AuxDataTraits<PackedLink<CONT>, VALLOC >::vector_type,
123  class ALLOC = AuxAllocator_t<VELT> >
125  : public AuxTypeVectorHolder<VELT,
126  typename AuxDataTraits<VELT, ALLOC>::vector_type>
127 {
128  using Base = AuxTypeVectorHolder<VELT,
130 
131 
132 public:
134  using Base::Base;
135  using vector_type = typename Base::vector_type;
137 
138 
141 
142 
151  vector_type* vecPtr,
152  IAuxTypeVector* linkedVec,
153  bool ownFlag);
154 
155 
178  virtual bool insertMove (size_t pos,
179  void* src, size_t src_pos, size_t src_n,
180  IAuxStore& srcStore) override;
181 
182 
183 protected:
186 };
187 
188 
189 //**************************************************************************
190 
191 
206 template <class HOLDER>
208  : public HOLDER
209 {
210 public:
211  using Base = HOLDER;
212  using vector_type = typename Base::vector_type;
213  using element_type = typename Base::element_type;
214  using vector_value_type = typename Base::vector_value_type;
215 
216 
225  size_t size, size_t capacity,
226  std::unique_ptr<IAuxTypeVector> linkedVec);
227 
228 
233 
234 
239 
240 
244 
245 
249  virtual std::unique_ptr<IAuxTypeVector> clone() const override;
250 
251 
255  virtual std::unique_ptr<IAuxTypeVector> linkedVector() override;
256 
257 
258 private:
261 
263  std::unique_ptr<IAuxTypeVector> m_linkedVecHolder;
264 };
265 
266 
267 //**************************************************************************
268 
269 
270 template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
272 
273 template <class CONT,
274  class VALLOC = AuxAllocator_t<PackedLink<CONT> >,
275  class VELT = typename AuxDataTraits<PackedLink<CONT>, VALLOC >::vector_type,
276  class ALLOC = AuxAllocator_t<VELT> >
278 
279 
280 } // namespace SG
281 
282 
284 
285 
286 #endif // not ATHCONTAINERS_PACKEDLINKVECTOR_H
SG::PackedLinkVVectorHolder::m_linkedVec
IAuxTypeVector * m_linkedVec
Interface for the linked vector of DataLinks.
Definition: PackedLinkVector.h:185
SG::AuxTypeVectorHolder< PackedLink< TARG >, AuxDataTraits< PackedLink< TARG >, VEC::allocator_type >::vector_type >::vector_type
AuxDataTraits< PackedLink< TARG >, VEC::allocator_type >::vector_type vector_type
Type of the STL vector used for storage.
Definition: AuxTypeVector.h:55
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::AuxAllocator_t
std::allocator< T > AuxAllocator_t
The default allocator type to use for auxiliary variables.
Definition: AuxDataTraits.h:28
SG::PackedLinkVectorHolder::PackedLinkVectorHolder
PackedLinkVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
SG::AuxTypeVectorHolder< PackedLink< TARG >, AuxDataTraits< PackedLink< TARG >, VEC::allocator_type >::vector_type >::element_type
AuxDataTraits< PackedLink< TARG > >::element_type element_type
Type that the user sees.
Definition: AuxTypeVector.h:58
SG::PackedLinkVectorHolder::insertMove
virtual bool insertMove(size_t pos, void *src, size_t src_pos, size_t src_n, IAuxStore &srcStore) override
Insert elements into the vector via move semantics.
SG::PackedLinkVectorT::PackedLinkVectorT
PackedLinkVectorT(auxid_t auxid, size_t size, size_t capacity, std::unique_ptr< IAuxTypeVector > linkedVec)
Constructor.
PackedLinkVectorHelper.h
Helper functions for managing PackedLink variables.
SG::PackedLinkVectorT::vector_value_type
typename Base::vector_value_type vector_value_type
Definition: PackedLinkVector.h:214
SG::AuxDataTraits::vector_type
std::vector< T, allocator_type > vector_type
Container type used to store this variable.
Definition: AuxDataTraits.h:53
SG::PackedLinkVVectorHolder::PackedLinkVVectorHolder
PackedLinkVVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
SG::detail::PackedLinkVectorHelper
Helper functions for managing PackedLink variables.
Definition: PackedLinkVectorHelper.h:256
SG::PackedLinkVectorT::PackedLinkVectorT
PackedLinkVectorT(const PackedLinkVectorT &other)
Copy constructor.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::PackedLinkVVectorHolder::insertMove
virtual bool insertMove(size_t pos, void *src, size_t src_pos, size_t src_n, IAuxStore &srcStore) override
Insert elements into the vector via move semantics.
SG::PackedLinkVectorHolder::m_linkedVec
IAuxTypeVector * m_linkedVec
Interface for the linked vector of DataLinks.
Definition: PackedLinkVector.h:101
SG::AuxDataTraits
Allow customizing how aux data types are treated.
Definition: AuxDataTraits.h:40
PackedLinkImpl.h
Definition of PackedLink type.
SG::PackedLinkVectorT::element_type
typename Base::element_type element_type
Definition: PackedLinkVector.h:213
SG::PackedLinkVectorT::Base
HOLDER Base
Definition: PackedLinkVector.h:211
SG::PackedLinkVectorT::m_vec
vector_type m_vec
The contained vector.
Definition: PackedLinkVector.h:260
SG::PackedLinkVectorT::m_linkedVecHolder
std::unique_ptr< IAuxTypeVector > m_linkedVecHolder
Holding ownership of the linked vector.
Definition: PackedLinkVector.h:263
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
AuxTypeVector.h
Implementation of IAuxTypeVector for specific types.
SG::PackedLinkVectorT::vector_type
typename Base::vector_type vector_type
Definition: PackedLinkVector.h:212
SG::IAuxTypeVector::auxid
auxid_t auxid() const
Return the auxid of the variable this vector represents.
Definition: IAuxTypeVector.h:232
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
SG::PackedLinkVectorT
Implementation of IAuxTypeVector holding a vector of PackedLink.
Definition: PackedLinkVector.h:209
PackedLinkVector.icc
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
SG::PackedLinkVectorT::operator=
PackedLinkVectorT & operator=(const PackedLinkVectorT &other)=delete
No assignment.
SG::PackedLinkVectorT::PackedLinkVectorT
PackedLinkVectorT(PackedLinkVectorT &&other)
Move constructor.
SG::PackedLinkVectorT::clone
virtual std::unique_ptr< IAuxTypeVector > clone() const override
Make a copy of this vector.
SG::PackedLinkVVectorHolder
Implementation of IAuxTypeVector for a vector of PackedLink.
Definition: PackedLinkVector.h:127
SG::PackedLinkVectorHolder
Implementation of IAuxTypeVector for PackedLink types.
Definition: PackedLinkVector.h:43
SG::AuxTypeVectorHolder
Implementation of IAuxTypeVector for specific types.
Definition: AuxTypeVector.h:52
SG::PackedLinkVectorT::linkedVector
virtual std::unique_ptr< IAuxTypeVector > linkedVector() override
Return ownership of the linked vector.