ATLAS Offline Software
Loading...
Searching...
No Matches
JaggedVecVector.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_JAGGEDVECVECTOR_H
14#define ATHCONTAINERS_JAGGEDVECVECTOR_H
15
16
20
21
22namespace SG {
23
24
25//**************************************************************************
26
27
38template <class T, class ALLOC = AuxAllocator_t<JaggedVecElt<T> > >
40 : public AuxTypeVectorHolder<JaggedVecElt<T>,
41 typename AuxDataTraits<JaggedVecElt<T>, ALLOC>::vector_type>
42{
44 using Shift = typename Elt::Shift;
45 using index_type = typename Elt::index_type;
48
49
50public:
52 using Base::Base;
55
56
65 vector_type* vecPtr,
66 IAuxTypeVector* linkedVec,
67 bool ownFlag);
68
69
77 virtual bool resize (size_t sz) override;
78
79
106 virtual bool shift (size_t pos, ptrdiff_t offs) override;
107
108
131 virtual bool insertMove (size_t pos,
132 void* src, size_t src_pos, size_t src_n,
133 IAuxStore& srcStore) override;
134
135
136protected:
139};
140
141
142//**************************************************************************
143
144
159template <class HOLDER>
161 : public HOLDER
162{
163public:
164 using Base = HOLDER;
165 using vector_type = typename Base::vector_type;
166 using element_type = typename Base::element_type;
167 using vector_value_type = typename Base::vector_value_type;
168
169
178 size_t size, size_t capacity,
179 std::unique_ptr<IAuxTypeVector> linkedVec);
180
181
186
187
192
193
197
198
202 virtual std::unique_ptr<IAuxTypeVector> clone() const override;
203
204
208 virtual std::unique_ptr<IAuxTypeVector> linkedVector() override;
209
210
211private:
214
216 std::unique_ptr<IAuxTypeVector> m_linkedVecHolder;
217};
218
219
220//**************************************************************************
221
222
223template <class T, class ALLOC = AuxAllocator_t<JaggedVecElt<T> > >
225
226
227} // namespace SG
228
229
231
232
233#endif // not ATHCONTAINERS_JAGGEDVECVECTOR_H
Implementation of IAuxTypeVector for specific types.
Manage lookup of vectors of auxiliary data.
Definition of JaggedVecElt.
static Double_t sz
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.
uint32_t index_type
Type for the indices.
Describe one element of a jagged vector.
typename Elt::index_type index_type
virtual bool resize(size_t sz) override
Change the size of the vector.
JaggedVecVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
virtual bool shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the vector.
typename Base::element_type element_type
typename Elt::Shift Shift
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.
AuxTypeVectorHolder< Elt, typename AuxDataTraits< Elt, ALLOC >::vector_type > Base
Implementation of IAuxTypeVector holding a vector of JaggedVec.
JaggedVecVectorT(auxid_t auxid, size_t size, size_t capacity, std::unique_ptr< IAuxTypeVector > linkedVec)
Constructor.
JaggedVecVectorT & operator=(const JaggedVecVectorT &other)=delete
No assignment.
typename Base::element_type element_type
typename Base::vector_value_type vector_value_type
virtual std::unique_ptr< IAuxTypeVector > linkedVector() override
typename Base::vector_type vector_type
virtual std::unique_ptr< IAuxTypeVector > clone() const override
Forward declaration.
JaggedVecVectorT< JaggedVecVectorHolder< T, ALLOC > > JaggedVecVector
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27
Helper to shift indices.