ATLAS Offline Software
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  */
13 #ifndef ATHCONTAINERS_JAGGEDVECVECTOR_H
14 #define ATHCONTAINERS_JAGGEDVECVECTOR_H
15 
16 
20 
21 
22 namespace SG {
23 
24 
25 //**************************************************************************
26 
27 
38 template <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 
50 public:
52  using Base::Base;
53  using vector_type = typename Base::vector_type;
54  using element_type = typename Base::element_type;
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 
136 protected:
139 };
140 
141 
142 //**************************************************************************
143 
144 
159 template <class HOLDER>
161  : public HOLDER
162 {
163 public:
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 
211 private:
214 
216  std::unique_ptr<IAuxTypeVector> m_linkedVecHolder;
217 };
218 
219 
220 //**************************************************************************
221 
222 
223 template <class T, class ALLOC = AuxAllocator_t<JaggedVecElt<T> > >
225 
226 
227 } // namespace SG
228 
229 
231 
232 
233 #endif // not ATHCONTAINERS_JAGGEDVECVECTOR_H
SG::AuxTypeVectorHolder< JaggedVecElt< T >, AuxDataTraits< JaggedVecElt< T >, VEC::allocator_type >::vector_type >::vector_type
AuxDataTraits< JaggedVecElt< T >, VEC::allocator_type >::vector_type vector_type
Type of the STL vector used for storage.
Definition: AuxTypeVector.h:55
SG::JaggedVecVectorT::element_type
typename Base::element_type element_type
Definition: JaggedVecVector.h:166
fitman.sz
sz
Definition: fitman.py:527
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::JaggedVecVectorHolder::Elt
JaggedVecElt< T > Elt
Definition: JaggedVecVector.h:43
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
SG::AuxTypeVectorHolder< JaggedVecElt< T >, AuxDataTraits< JaggedVecElt< T >, VEC::allocator_type >::vector_type >::element_type
AuxDataTraits< JaggedVecElt< T > >::element_type element_type
Type that the user sees.
Definition: AuxTypeVector.h:58
SG::JaggedVecVectorHolder::m_linkedVec
IAuxTypeVector * m_linkedVec
Interface for the linked vector of DataLinks.
Definition: JaggedVecVector.h:138
SG::JaggedVecVectorT::vector_value_type
typename Base::vector_value_type vector_value_type
Definition: JaggedVecVector.h:167
SG::JaggedVecVectorT::JaggedVecVectorT
JaggedVecVectorT(auxid_t auxid, size_t size, size_t capacity, std::unique_ptr< IAuxTypeVector > linkedVec)
Constructor.
SG::AuxDataTraits::vector_type
std::vector< T, allocator_type > vector_type
Container type used to store this variable.
Definition: AuxDataTraits.h:53
SG::JaggedVecVectorHolder
Implementation of IAuxTypeVector for JaggedVec types.
Definition: JaggedVecVector.h:42
JaggedVecVector.icc
SG::JaggedVecVectorHolder::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.
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::JaggedVecEltBase::index_type
uint32_t index_type
Type for the indices.
Definition: JaggedVecImpl.h:56
SG::JaggedVecVectorT::JaggedVecVectorT
JaggedVecVectorT(JaggedVecVectorT &&other)
Move constructor.
SG::JaggedVecVectorT::Base
HOLDER Base
Definition: JaggedVecVector.h:164
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::JaggedVecVectorT::clone
virtual std::unique_ptr< IAuxTypeVector > clone() const override
Make a copy of this vector.
SG::JaggedVecVectorT::m_vec
vector_type m_vec
The contained vector.
Definition: JaggedVecVector.h:213
SG::JaggedVecVectorT::linkedVector
virtual std::unique_ptr< IAuxTypeVector > linkedVector() override
Return ownership of the linked vector.
SG::JaggedVecVectorHolder< T, VEC::allocator_type >::Shift
typename Elt::Shift Shift
Definition: JaggedVecVector.h:44
SG::JaggedVecVectorT::operator=
JaggedVecVectorT & operator=(const JaggedVecVectorT &other)=delete
No assignment.
SG::JaggedVecVectorHolder::resize
virtual bool resize(size_t sz) override
Change the size of the vector.
SG::JaggedVecVectorHolder::JaggedVecVectorHolder
JaggedVecVectorHolder(auxid_t auxid, vector_type *vecPtr, IAuxTypeVector *linkedVec, bool ownFlag)
Constructor.
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
AuxTypeVector.h
Implementation of IAuxTypeVector for specific types.
SG::JaggedVecVectorT::JaggedVecVectorT
JaggedVecVectorT(const JaggedVecVectorT &other)
Copy constructor.
SG::IAuxTypeVector::auxid
auxid_t auxid() const
Return the auxid of the variable this vector represents.
Definition: IAuxTypeVector.h:232
SG::JaggedVecVectorT::vector_type
typename Base::vector_type vector_type
Definition: JaggedVecVector.h:165
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
JaggedVecImpl.h
Definition of JaggedVecElt.
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
SG::JaggedVecElt
Describe one element of a jagged vector.
Definition: JaggedVecImpl.h:132
SG::JaggedVecVectorHolder::shift
virtual bool shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the vector.
SG::JaggedVecVectorHolder< T, VEC::allocator_type >::index_type
typename Elt::index_type index_type
Definition: JaggedVecVector.h:45
SG::JaggedVecVectorT
Implementation of IAuxTypeVector holding a vector of JaggedVec.
Definition: JaggedVecVector.h:162
SG::AuxTypeVectorHolder
Implementation of IAuxTypeVector for specific types.
Definition: AuxTypeVector.h:52
SG::JaggedVecVectorT::m_linkedVecHolder
std::unique_ptr< IAuxTypeVector > m_linkedVecHolder
Holding ownership of the linked vector.
Definition: JaggedVecVector.h:216
SG::JaggedVecEltBase::Shift
friend struct Shift
Definition: JaggedVecImpl.h:119