ATLAS Offline Software
IAuxTypeVector.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 ATHCONTAINERSINTERFACES_IAUXTYPEVECTOR_H
14 #define ATHCONTAINERSINTERFACES_IAUXTYPEVECTOR_H
15 
16 
19 #include <cstddef>
20 #include <memory>
21 #include <typeinfo>
22 
23 
24 namespace SG {
25 
26 
27 class AuxDataOption;
28 
29 
40 {
41 public:
48  : m_auxid (auxid),
50  {}
51 
52 
54  virtual ~IAuxTypeVector() = default;
55 
56 
60  virtual std::unique_ptr<IAuxTypeVector> clone() const = 0;
61 
62 
66  virtual void* toPtr() = 0;
67 
68 
72  virtual const void* toPtr() const = 0;
73 
74 
78  virtual void* toVector() = 0;
79 
80 
84  virtual size_t size() const = 0;
85 
86 
94  virtual bool resize (size_t sz) = 0;
95 
96 
101  virtual void reserve (size_t sz) = 0;
102 
103 
130  virtual bool shift (size_t pos, ptrdiff_t offs) = 0;
131 
132 
154  virtual bool insertMove (size_t pos, void* beg, void* end,
155  IAuxStore& srcStore) = 0;
156 
157 
167  virtual bool setOption (const AuxDataOption& /*option*/)
168  { return false; }
169 
170 
183  virtual std::unique_ptr<IAuxTypeVector> toPacked() { return 0; }
184 
185 
197  virtual const std::type_info* objType() const { return 0; }
198 
199 
212  virtual std::unique_ptr<IAuxTypeVector> linkedVector() { return nullptr; }
213 
214 
221  bool isLinked() const { return m_isLinked; }
222 
223 
227  auxid_t auxid() const
228  {
229  return m_auxid;
230  }
231 
232 
233 private:
236 
239 };
240 
241 
242 } // namespace SG
243 
244 
245 #endif // not ATHCONTAINERSINTERFACES_IAUXTYPEVECTOR_H
SG::IAuxTypeVector::shift
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
SG::IAuxTypeVector::isLinked
bool isLinked() const
Return true if this variable is linked from another one.
Definition: IAuxTypeVector.h:221
fitman.sz
sz
Definition: fitman.py:527
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::IAuxTypeVector::toPtr
virtual const void * toPtr() const =0
Return a pointer to the start of the vector's data.
SG::IAuxTypeVector::~IAuxTypeVector
virtual ~IAuxTypeVector()=default
Destructor.
SG::IAuxTypeVector::objType
virtual const std::type_info * objType() const
Return the type of the complete object to be saved.
Definition: IAuxTypeVector.h:197
SG::IAuxTypeVector::clone
virtual std::unique_ptr< IAuxTypeVector > clone() const =0
Make a copy of this vector.
SG::IAuxTypeVector::toPacked
virtual std::unique_ptr< IAuxTypeVector > toPacked()
Make a packed version of the variable.
Definition: IAuxTypeVector.h:183
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::IAuxTypeVector::toVector
virtual void * toVector()=0
Return a pointer to the STL vector itself.
SG::IAuxTypeVector::IAuxTypeVector
IAuxTypeVector(auxid_t auxid, bool isLinked)
Constructor.
Definition: IAuxTypeVector.h:47
SG::IAuxTypeVector::linkedVector
virtual std::unique_ptr< IAuxTypeVector > linkedVector()
Return IAuxTypeVector of a linked variable, if there is one.
Definition: IAuxTypeVector.h:212
SG::AuxDataOption
Hold information about an option setting request.
Definition: AuxDataOption.h:37
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
SG::IAuxTypeVector::auxid
auxid_t auxid() const
Return the auxid of the variable this vector represents.
Definition: IAuxTypeVector.h:227
SG::IAuxTypeVector::m_auxid
auxid_t m_auxid
The auxid of the variable this vector represents.
Definition: IAuxTypeVector.h:235
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
AuxTypes.h
Basic definitions for auxiliary types.
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
SG::IAuxTypeVector::m_isLinked
bool m_isLinked
True if this variable is linked from another one.
Definition: IAuxTypeVector.h:238
SG::IAuxTypeVector::resize
virtual bool resize(size_t sz)=0
Change the size of the vector.
SG::IAuxTypeVector::insertMove
virtual bool insertMove(size_t pos, void *beg, void *end, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
SG::IAuxTypeVector::reserve
virtual void reserve(size_t sz)=0
Change the capacity of the vector.
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:40
IAuxStore.h
Interface for non-const operations on an auxiliary store.
SG::IAuxTypeVector::setOption
virtual bool setOption(const AuxDataOption &)
Set an option for this variable.
Definition: IAuxTypeVector.h:167
SG::IAuxTypeVector::size
virtual size_t size() const =0
Return the size of the vector.
SG::IAuxTypeVector::toPtr
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.