ATLAS Offline Software
PackedLinkPersVector.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  */
17 #ifndef XAODCORE_PACKEDLINKPERSVECTOR_H
18 #define XAODCORE_PACKEDLINKPERSVECTOR_H
19 
20 
23 
24 
25 namespace xAOD {
26 
30  template< class TARG, class VEC >
31  class AuxPersVector<SG::PackedLink<TARG>, VEC>
32  : public SG::PackedLinkVectorHolder<TARG, typename VEC::allocator_type> {
33 
34  public:
36  typedef VEC& vector_type;
37 
40  : SG::PackedLinkVectorHolder<TARG, typename VEC::allocator_type>
41  (auxid, &vec, store->linkedVector( auxid ), false)
42  {
43  assert( !isLinked );
44  }
45 
46  virtual std::unique_ptr<SG::IAuxTypeVector> clone() const override {
47  return std::make_unique<AuxPersVector>(*this);
48  }
49  }; // class AuxPersVector
50 
51 
55  template< class TARG, class VALLOC, class VEC >
56  class AuxPersVector<std::vector<SG::PackedLink<TARG>, VALLOC>, VEC> :
57  public SG::PackedLinkVVectorHolder<TARG, VALLOC,
58  std::vector<SG::PackedLink<TARG>, VALLOC>,
59  typename VEC::allocator_type> {
60 
61  public:
63  typedef VEC& vector_type;
64 
67  : SG::PackedLinkVVectorHolder<TARG, VALLOC,
68  std::vector<SG::PackedLink<TARG>, VALLOC>,
69  typename VEC::allocator_type>
70  (auxid, &vec, store->linkedVector( auxid ), false)
71  {
72  assert( !isLinked );
73  }
74 
75  virtual std::unique_ptr<SG::IAuxTypeVector> clone() const override {
76  return std::make_unique<AuxPersVector>(*this);
77  }
78  }; // class AuxPersVector
79 
80 
81 } // namespace xAOD
82 
83 
84 #endif // not XAODCORE_PACKEDLINKPERSVECTOR_H
SG::IAuxTypeVector::isLinked
bool isLinked() const
Return true if this variable is linked from another one.
Definition: IAuxTypeVector.h:226
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
AuxPersVector.h
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
vector
Definition: MultiHisto.h:13
SG::IAuxTypeVector::linkedVector
virtual std::unique_ptr< IAuxTypeVector > linkedVector()
Return IAuxTypeVector of a linked variable, if there is one.
Definition: IAuxTypeVector.h:217
xAOD::AuxPersVector
Class managing concrete vector variables.
Definition: AuxPersVector.h:28
SG::IAuxTypeVector::auxid
auxid_t auxid() const
Return the auxid of the variable this vector represents.
Definition: IAuxTypeVector.h:232
python.Dumpers.typename
def typename(t)
Definition: Dumpers.py:194
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
SG::PackedLinkVVectorHolder
Implementation of IAuxTypeVector for a vector of PackedLink.
Definition: PackedLinkVector.h:127
SG::PackedLinkVectorHolder
Implementation of IAuxTypeVector for PackedLink types.
Definition: PackedLinkVector.h:43