ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
xAOD::AuxPersInfo< T > Class Template Reference

Class managing concrete persistent variables. More...

#include <AuxPersInfo.h>

Inheritance diagram for xAOD::AuxPersInfo< T >:
Collaboration diagram for xAOD::AuxPersInfo< T >:

Public Types

typedef T & info_type
 Convenience type definition. More...
 

Public Member Functions

 AuxPersInfo (SG::auxid_t auxid, info_type info)
 Constructor. More...
 
virtual SG::auxid_t auxid () const override
 Return the auxid of the variable this vector represents. More...
 
virtual std::unique_ptr< SG::IAuxTypeVectorclone () const override
 Make a copy of this vector. More...
 
virtual void * toPtr () override
 Return a pointer to the start of the vector's data. More...
 
virtual const void * toPtr () const override
 Return a pointer to the start of the vector's data. More...
 
virtual void * toVector () override
 Return a pointer to the STL vector itself. More...
 
virtual size_t size () const override
 Return the size of the vector. More...
 
virtual bool resize (size_t sz) override
 Change the size of the vector. More...
 
virtual void reserve (size_t sz) override
 Change the capacity of the vector. More...
 
virtual bool shift (size_t, ptrdiff_t) override
 Shift the elements of the vector. More...
 
virtual bool insertMove (size_t, void *, void *, SG::IAuxStore &) override
 Insert elements into the vector via move semantics. More...
 
virtual const std::type_info * objType () const override
 Return the type of the complete object to be saved. More...
 
virtual bool setOption (const AuxDataOption &)
 Set an option for this variable. More...
 
virtual std::unique_ptr< IAuxTypeVector > toPacked ()
 Make a packed version of the variable. More...
 

Private Attributes

info_type m_info
 Reference to the info being handled. More...
 
SG::auxid_t m_auxid
 

Detailed Description

template<class T>
class xAOD::AuxPersInfo< T >

Class managing concrete persistent variables.

This class is used internally by the "special" auxiliary store objects to manage the auxiliary variables handled by them. User code probably doesn't want to touch it directly...

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Revision
793737
Date
2017-01-24 21:11:10 +0100 (Tue, 24 Jan 2017)

Definition at line 31 of file AuxPersInfo.h.

Member Typedef Documentation

◆ info_type

template<class T >
typedef T& xAOD::AuxPersInfo< T >::info_type

Convenience type definition.

Definition at line 35 of file AuxPersInfo.h.

Constructor & Destructor Documentation

◆ AuxPersInfo()

template<class T >
xAOD::AuxPersInfo< T >::AuxPersInfo ( SG::auxid_t  auxid,
info_type  info 
)
inline

Constructor.

Definition at line 38 of file AuxPersInfo.h.

38  :
39  m_info( info ), m_auxid( auxid ) {}

Member Function Documentation

◆ auxid()

template<class T >
virtual SG::auxid_t xAOD::AuxPersInfo< T >::auxid ( ) const
inlineoverridevirtual

Return the auxid of the variable this vector represents.

Implements SG::IAuxTypeVector.

Definition at line 41 of file AuxPersInfo.h.

41  {
42  return m_auxid;
43  }

◆ clone()

template<class T >
virtual std::unique_ptr<SG::IAuxTypeVector> xAOD::AuxPersInfo< T >::clone ( ) const
inlineoverridevirtual

Make a copy of this vector.

Implements SG::IAuxTypeVector.

Definition at line 45 of file AuxPersInfo.h.

45  {
46  return std::make_unique<AuxPersInfo<T> >(*this);
47  }

◆ insertMove()

template<class T >
virtual bool xAOD::AuxPersInfo< T >::insertMove ( size_t  pos,
void *  beg,
void *  end,
SG::IAuxStore srcStore 
)
inlineoverridevirtual

Insert elements into the vector via move semantics.

Parameters
posThe starting index of the insertion.
begStart of the range of elements to insert.
endEnd of the range of elements to insert.
srcStoreThe source store.

beg and end define a range of container elements, with length len defined by the difference of the pointers divided by the element size.

The size of the container will be increased by len, with the elements starting at pos copied to pos+len.

The contents of the beg:end range will then be moved to our vector starting at pos. This will be done via move semantics if possible; otherwise, it will be done with a copy.

Returns true if it is known that the vector's memory did not move, false otherwise.

Implements SG::IAuxTypeVector.

Definition at line 78 of file AuxPersInfo.h.

80  {
81  throw std::runtime_error( "Calling insertMove on a non-vector" );
82  }

◆ objType()

template<class T >
virtual const std::type_info* xAOD::AuxPersInfo< T >::objType ( ) const
inlineoverridevirtual

Return the type of the complete object to be saved.

For example, if the object is a std::vector, then we return the type_info of the vector. But if we're holding a PackedContainer, then we return the type_info of the PackedContainer.

Can return null if the operation is not supported. In that case, I/O will use the type found from the variable registry.

Reimplemented from SG::IAuxTypeVector.

Definition at line 84 of file AuxPersInfo.h.

84  {
85  return &typeid(T);
86  }

◆ reserve()

template<class T >
virtual void xAOD::AuxPersInfo< T >::reserve ( size_t  sz)
inlineoverridevirtual

Change the capacity of the vector.

Parameters
szThe new vector capacity.

Implements SG::IAuxTypeVector.

Definition at line 68 of file AuxPersInfo.h.

68  {
69  if( sz != 1 ) {
70  throw std::runtime_error( "Calling reserve with != 1 on a "
71  "non-vector" );
72  }
73  }

◆ resize()

template<class T >
virtual bool xAOD::AuxPersInfo< T >::resize ( size_t  sz)
inlineoverridevirtual

Change the size of the vector.

Parameters
szThe new vector size. Returns true if it is known that iterators have not been invalidated; false otherwise. (Will always return false when increasing the size of an empty container.)

Implements SG::IAuxTypeVector.

Definition at line 61 of file AuxPersInfo.h.

61  {
62  if( sz != 1 ) {
63  throw std::runtime_error( "Calling resize with != 1 on a "
64  "non-vector" );
65  }
66  return true;
67  }

◆ setOption()

virtual bool SG::IAuxTypeVector::setOption ( const AuxDataOption )
inlinevirtualinherited

Set an option for this variable.

Parameters
optionThe option to set.

The interpretation of the option depends on the particular representation of the variable provided by the concrete class.

Returns true if the option setting was successful; false otherwise.

Reimplemented in SG::AuxTypeVectorHolder< T, CONT >, and SG::AuxTypeVectorHolder< T, std::vector< T > >.

Definition at line 162 of file IAuxTypeVector.h.

163  { return false; }

◆ shift()

template<class T >
virtual bool xAOD::AuxPersInfo< T >::shift ( size_t  pos,
ptrdiff_t  offs 
)
inlineoverridevirtual

Shift the elements of the vector.

Parameters
posThe starting index for the shift.
offsThe (signed) amount of the shift.

This operation shifts the elements in the vectors for all aux data items, to implement an insertion or deletion. offs may be either positive or negative.

If offs is positive, then the container is growing. The container size should be increased by offs, the element at pos moved to pos + offs, and similarly for following elements. The elements between pos and pos + offs should be default-initialized.

If offs is negative, then the container is shrinking. The element at pos should be moved to pos + offs, and similarly for following elements. The container should then be shrunk by -offs elements (running destructors as appropriate).

Returns true if it is known that iterators have not been invalidated; false otherwise. (Will always return false when increasing the size of an empty container.)

Implements SG::IAuxTypeVector.

Definition at line 74 of file AuxPersInfo.h.

74  {
75  throw std::runtime_error( "Calling shift on a non-vector" );
76  }

◆ size()

template<class T >
virtual size_t xAOD::AuxPersInfo< T >::size ( ) const
inlineoverridevirtual

Return the size of the vector.

Implements SG::IAuxTypeVector.

Definition at line 58 of file AuxPersInfo.h.

58  {
59  return 1;
60  }

◆ toPacked()

virtual std::unique_ptr<IAuxTypeVector> SG::IAuxTypeVector::toPacked ( )
inlinevirtualinherited

Make a packed version of the variable.

If possible, return a new vector object that stores the data in a PackedContainer. The data itself should be moved to the new container (so that this vector becomes empty). This ensures that pointers to the data are preserved.

If successful, a newly-allocated object is returned. A null pointer is returned on failure (operation not supported, type can't be packed, type is already packed).

Reimplemented in SG::AuxTypeVectorHolder< T, CONT >, and SG::AuxTypeVectorHolder< T, std::vector< T > >.

Definition at line 178 of file IAuxTypeVector.h.

178 { return 0; }

◆ toPtr() [1/2]

template<class T >
virtual const void* xAOD::AuxPersInfo< T >::toPtr ( ) const
inlineoverridevirtual

Return a pointer to the start of the vector's data.

Implements SG::IAuxTypeVector.

Definition at line 52 of file AuxPersInfo.h.

52  {
53  return &m_info;
54  }

◆ toPtr() [2/2]

template<class T >
virtual void* xAOD::AuxPersInfo< T >::toPtr ( )
inlineoverridevirtual

Return a pointer to the start of the vector's data.

Implements SG::IAuxTypeVector.

Definition at line 49 of file AuxPersInfo.h.

49  {
50  return &m_info;
51  }

◆ toVector()

template<class T >
virtual void* xAOD::AuxPersInfo< T >::toVector ( )
inlineoverridevirtual

Return a pointer to the STL vector itself.

Implements SG::IAuxTypeVector.

Definition at line 55 of file AuxPersInfo.h.

55  {
56  return &m_info;
57  }

Member Data Documentation

◆ m_auxid

template<class T >
SG::auxid_t xAOD::AuxPersInfo< T >::m_auxid
private

Definition at line 92 of file AuxPersInfo.h.

◆ m_info

template<class T >
info_type xAOD::AuxPersInfo< T >::m_info
private

Reference to the info being handled.

Definition at line 90 of file AuxPersInfo.h.


The documentation for this class was generated from the following file:
grepfile.info
info
Definition: grepfile.py:38
beamspotPlotBcids.sz
sz
Definition: beamspotPlotBcids.py:521
xAOD::AuxPersInfo::m_info
info_type m_info
Reference to the info being handled.
Definition: AuxPersInfo.h:90
xAOD::AuxPersInfo::m_auxid
SG::auxid_t m_auxid
Definition: AuxPersInfo.h:92
xAOD::AuxPersInfo::auxid
virtual SG::auxid_t auxid() const override
Return the auxid of the variable this vector represents.
Definition: AuxPersInfo.h:41
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35