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-2024 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
94 virtual bool insertMove (size_t pos,
95 void* src, size_t src_pos, size_t src_n,
96 IAuxStore& srcStore) override;
97
98
99protected:
102};
103
104
105//**************************************************************************
106
107
120template <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{
130
131
132public:
134 using Base::Base;
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
183protected:
186};
187
188
189//**************************************************************************
190
191
206template <class HOLDER>
208 : public HOLDER
209{
210public:
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
258private:
261
263 std::unique_ptr<IAuxTypeVector> m_linkedVecHolder;
264};
265
266
267//**************************************************************************
268
269
270template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
272
273template <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
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.
auxid_t auxid() const
Return the auxid of the variable this vector represents.
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.
AuxTypeVectorHolder< PackedLink< CONT >, typename AuxDataTraits< PackedLink< CONT >, ALLOC >::vector_type > Base
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.
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.
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