ATLAS Offline Software
Loading...
Searching...
No Matches
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-2026 CERN for the benefit of the ATLAS collaboration.
4 */
11
12
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
26namespace SG {
27
28
39template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
41 : public AuxTypeVectorHolder<PackedLink<CONT>,
42 typename AuxDataTraits<PackedLink<CONT>, ALLOC>::vector_type>
43{
46
47
48public:
50 using Base::Base;
53
54
57
58
67 vector_type* vecPtr,
68 IAuxTypeVector* linkedVec,
69 bool ownFlag);
70
71
90 virtual bool insertMove (size_t pos,
91 void* src, size_t src_pos, size_t src_n,
92 IAuxStore& srcStore) override;
93
94
95protected:
98};
99
100
101//**************************************************************************
102
103
116template <class CONT,
117 class VALLOC = AuxAllocator_t<PackedLink<CONT> >,
118 class VELT = typename AuxDataTraits<PackedLink<CONT>, VALLOC >::vector_type,
119 class ALLOC = AuxAllocator_t<VELT> >
121 : public AuxTypeVectorHolder<VELT,
122 typename AuxDataTraits<VELT, ALLOC>::vector_type>
123{
126
127
128public:
130 using Base::Base;
133
134
137
138
147 vector_type* vecPtr,
148 IAuxTypeVector* linkedVec,
149 bool ownFlag);
150
151
174 virtual bool insertMove (size_t pos,
175 void* src, size_t src_pos, size_t src_n,
176 IAuxStore& srcStore) override;
177
178
179protected:
182};
183
184
185//**************************************************************************
186
187
202template <class HOLDER>
204 : public HOLDER
205{
206public:
207 using Base = HOLDER;
208 using vector_type = typename Base::vector_type;
209 using element_type = typename Base::element_type;
210 using vector_value_type = typename Base::vector_value_type;
211
212
221 size_t size, size_t capacity,
222 std::unique_ptr<IAuxTypeVector> linkedVec);
223
224
229
230
235
236
240
241
245 virtual std::unique_ptr<IAuxTypeVector> clone() const override;
246
247
251 virtual std::unique_ptr<IAuxTypeVector> linkedVector() override;
252
253
254private:
257
259 std::unique_ptr<IAuxTypeVector> m_linkedVecHolder;
260};
261
262
263//**************************************************************************
264
265
266template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
268
269template <class CONT,
270 class VALLOC = AuxAllocator_t<PackedLink<CONT> >,
271 class VELT = typename AuxDataTraits<PackedLink<CONT>, VALLOC >::vector_type,
272 class ALLOC = AuxAllocator_t<VELT> >
274
275
276} // namespace SG
277
278
280
281
282#endif // not ATHCONTAINERS_PACKEDLINKVECTOR_H
Implementation of IAuxTypeVector for specific types.
Manage lookup of vectors of auxiliary data.
Definition of PackedLink type.
Helper functions for managing PackedLink variables.
Allow customizing how aux data types are treated.
std::vector< T, allocator_type > vector_type
Container type used to store this variable.
CONT vector_type
Type of the STL vector used for storage.
AuxTypeVectorHolder(auxid_t auxid, vector_type *vecPtr, bool ownFlag, bool isLinked)
Constructor.
AuxDataTraits< T >::element_type element_type
Type that the user sees.
Interface for non-const operations on an auxiliary store.
Definition IAuxStore.h:48
Abstract interface for manipulating vectors of arbitrary types.
PackedLinkVVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
AuxTypeVectorHolder< VELT, typename AuxDataTraits< VELT, ALLOC >::vector_type > Base
typename Base::element_type element_type
detail::PackedLinkVectorHelper< CONT > Helper
Helper for manipulating PackedLink instances.
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.
IAuxTypeVector * m_linkedVec
Interface for the linked vector of DataLinks.
typename Base::vector_type vector_type
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.
IAuxTypeVector * m_linkedVec
Interface for the linked vector of DataLinks.
typename Base::vector_type vector_type
typename Base::element_type element_type
detail::PackedLinkVectorHelper< CONT > Helper
Helper for manipulating PackedLink instances.
PackedLinkVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
AuxTypeVectorHolder< PackedLink< CONT >, typename AuxDataTraits< PackedLink< CONT >, ALLOC >::vector_type > Base
Implementation of IAuxTypeVector holding a vector of PackedLink.
virtual std::unique_ptr< IAuxTypeVector > linkedVector() override
typename Base::element_type element_type
typename Base::vector_value_type vector_value_type
typename Base::vector_type vector_type
virtual std::unique_ptr< IAuxTypeVector > clone() const override
PackedLinkVectorT(auxid_t auxid, size_t size, size_t capacity, std::unique_ptr< IAuxTypeVector > linkedVec)
Constructor.
PackedLinkVectorT & operator=(const PackedLinkVectorT &other)=delete
No assignment.
Helper functions for managing PackedLink variables.
Forward declaration.
SG::auxid_t auxid() const
Return the aux id for this variable.
PackedLinkVectorT< PackedLinkVVectorHolder< CONT, VALLOC, VELT, ALLOC > > PackedLinkVVector
PackedLinkVectorT< PackedLinkVectorHolder< CONT, ALLOC > > PackedLinkVector
std::allocator< T > AuxAllocator_t
The default allocator type to use for auxiliary variables.
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27