ATLAS Offline Software
PackedLinkVectorFactory.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  */
14 #ifndef ATHCONTAINERS_PACKEDLINKVECTORFACTORY_H
15 #define ATHCONTAINERS_PACKEDLINKVECTORFACTORY_H
16 
17 
20 #include "AthLinks/DataLink.h"
21 
22 
23 namespace SG {
24 
25 
32 template <class CONT, class ALLOC = AuxAllocator_t<PackedLink<CONT> > >
34  : public AuxTypeVectorFactoryImpl<PackedLink<CONT>, ALLOC>
35 {
36 public:
41 
42 
51  virtual
52  std::unique_ptr<IAuxTypeVector> create (SG::auxid_t auxid,
53  size_t size,
54  size_t capacity,
55  bool isLinked) const override;
56 
57 
73  virtual
74  std::unique_ptr<IAuxTypeVector> createFromData (SG::auxid_t auxid,
75  void* data,
76  IAuxTypeVector* linkedVector,
77  bool isPacked,
78  bool ownFlag,
79  bool isLinked) const override;
80 
81 
93  virtual void copy (SG::auxid_t auxid,
94  AuxVectorData& dst, size_t dst_index,
95  const AuxVectorData& src, size_t src_index,
96  size_t n) const override;
97 
98 
111  virtual void copyForOutput (SG::auxid_t auxid,
112  AuxVectorData& dst, size_t dst_index,
113  const AuxVectorData& src, size_t src_index,
114  size_t n) const override;
115 
116 
117 
130  virtual void swap (SG::auxid_t auxid,
131  AuxVectorData& a, size_t aindex,
132  AuxVectorData& b, size_t bindex,
133  size_t n) const override;
134 };
135 
136 
142 template <class CONT, class ALLOC>
143 class AuxTypeVectorFactory<PackedLink<CONT>, ALLOC>
144  : public PackedLinkVectorFactory<CONT, ALLOC>
145 {
149  using Base::Base;
150 };
151 
152 
153 //**************************************************************************
154 
155 
162 template <class CONT,
163  class VALLOC = AuxAllocator_t<PackedLink<CONT> >,
164  class VELT = typename AuxDataTraits<PackedLink<CONT>, VALLOC >::vector_type,
165  class ALLOC = AuxAllocator_t<VELT> >
167  : public AuxTypeVectorFactoryImpl<VELT, ALLOC>
168 {
169 public:
174 
175 
184  virtual
185  std::unique_ptr<IAuxTypeVector> create (SG::auxid_t auxid,
186  size_t size,
187  size_t capacity,
188  bool isLinked) const override;
189 
190 
206  virtual
207  std::unique_ptr<IAuxTypeVector> createFromData (SG::auxid_t auxid,
208  void* data,
209  IAuxTypeVector* linkedVector,
210  bool isPacked,
211  bool ownFlag,
212  bool isLinked) const override;
213 
214 
226  virtual void copy (SG::auxid_t auxid,
227  AuxVectorData& dst, size_t dst_index,
228  const AuxVectorData& src, size_t src_index,
229  size_t n) const override;
230 
231 
244  virtual void copyForOutput (SG::auxid_t auxid,
245  AuxVectorData& dst, size_t dst_index,
246  const AuxVectorData& src, size_t src_index,
247  size_t n) const override;
248 
249 
250 
263  virtual void swap (SG::auxid_t auxid,
264  AuxVectorData& a, size_t aindex,
265  AuxVectorData& b, size_t bindex,
266  size_t n) const override;
267 };
268 
269 
275 template <class CONT, class VALLOC, class ALLOC>
276 class AuxTypeVectorFactory<std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
277  : public PackedLinkVVectorFactory<CONT, VALLOC, std::vector<PackedLink<CONT>, VALLOC>, ALLOC>
278 {
282  using Base::Base;
283 };
284 
285 
286 } // namespace SG
287 
288 
290 
291 
292 #endif // not ATHCONTAINERS_PACKEDLINKVECTORFACTORY_H
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SG::PackedLinkVVectorFactory::copy
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const override
Copy elements between vectors.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
PackedLinkVectorFactory.icc
SG::PackedLinkVectorFactory::createFromData
virtual std::unique_ptr< IAuxTypeVector > createFromData(SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag, bool isLinked) const override
Create a vector object of this type from a data blob.
SG::AuxAllocator_t
std::allocator< T > AuxAllocator_t
The default allocator type to use for auxiliary variables.
Definition: AuxDataTraits.h:28
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
SG::PackedLinkVectorFactory::swap
virtual void swap(SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const override
Swap elements between vectors.
SG::AuxTypeVectorFactory
Factory object that creates vectors using AuxTypeVector.
Definition: AuxTypeVectorFactory.h:219
AuxTypeVectorFactory.h
Factory object that creates vectors using AuxTypeVector.
SG::PackedLinkVectorFactory
Factory object that creates vectors for packed links.
Definition: PackedLinkVectorFactory.h:35
SG::PackedLinkVectorT::vector_value_type
typename Base::vector_value_type vector_value_type
Definition: PackedLinkVector.h:214
SG::PackedLinkVVectorFactory
Factory object that creates vectors of vectors of packed links.
Definition: PackedLinkVectorFactory.h:168
SG::detail::PackedLinkVectorHelper
Helper functions for managing PackedLink variables.
Definition: PackedLinkVectorHelper.h:256
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::PackedLinkVectorFactory::copyForOutput
virtual void copyForOutput(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const override
Copy elements between vectors, possibly applying thinning.
SG::AuxTypeVectorFactoryImpl::vector_value_type
typename AuxTypeVector_t::vector_value_type vector_value_type
Definition: AuxTypeVectorFactory.h:44
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeVectorT
Implementation of IAuxTypeVector holding a vector instance.
Definition: AuxTypeVector.h:321
SG::AuxTypeVectorFactoryImpl::AuxTypeVector_t
AuxTypeVector< T, ALLOC > AuxTypeVector_t
Definition: AuxTypeVectorFactory.h:42
beamspotman.n
n
Definition: beamspotman.py:731
SG::AuxDataTraits
Allow customizing how aux data types are treated.
Definition: AuxDataTraits.h:40
SG::PackedLinkVVectorFactory::create
virtual std::unique_ptr< IAuxTypeVector > create(SG::auxid_t auxid, size_t size, size_t capacity, bool isLinked) const override
Create a vector object of this type.
vector
Definition: MultiHisto.h:13
SG::PackedLinkVVectorFactory::copyForOutput
virtual void copyForOutput(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const override
Copy elements between vectors, possibly applying thinning.
SG::AuxTypeVectorFactoryImpl
Factory object that creates vectors using AuxTypeVector.
Definition: AuxTypeVectorFactory.h:40
SG::PackedLinkVVectorFactory::createFromData
virtual std::unique_ptr< IAuxTypeVector > createFromData(SG::auxid_t auxid, void *data, IAuxTypeVector *linkedVector, bool isPacked, bool ownFlag, bool isLinked) const override
Create a vector object of this type from a data blob.
SG::PackedLinkVectorFactory::create
virtual std::unique_ptr< IAuxTypeVector > create(SG::auxid_t auxid, size_t size, size_t capacity, bool isLinked) const override
Create a vector object of this type.
SG::PackedLinkVectorFactory::copy
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const override
Copy elements between vectors.
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
SG::PackedLinkVectorT
Implementation of IAuxTypeVector holding a vector of PackedLink.
Definition: PackedLinkVector.h:209
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::PackedLinkVectorFactory::vector_value_type
typename AuxTypeVector_t::vector_value_type vector_value_type
Definition: PackedLinkVectorFactory.h:40
SG::PackedLinkVVectorFactory::swap
virtual void swap(SG::auxid_t auxid, AuxVectorData &a, size_t aindex, AuxVectorData &b, size_t bindex, size_t n) const override
Swap elements between vectors.
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
PackedLinkVector.h
Implementation of IAuxTypeVector for PackedLink types.