ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
SG::ViewVectorBase Class Referenceabstract

Hold the persistent representation for a ViewVector. More...

#include <ViewVectorBase.h>

Inheritance diagram for SG::ViewVectorBase:
Collaboration diagram for SG::ViewVectorBase:

Public Member Functions

virtual ~ViewVectorBase ()=default
 Destructor. More...
 
virtual void toPersistent ()=0
 Convert the vector to persistent form. More...
 
virtual void toTransient ()=0
 Convert the vector to transient form. More...
 
void clearPersistent ()
 Clear the persistent data. More...
 
void setClearOnPersistent ()
 Set a flag to declare that the vector should be cleared on the next call to toPersistent(). More...
 

Protected Member Functions

template<class DV >
void doToPersistent1 (DV &v, const std::true_type &)
 Convert to persistent form. More...
 
template<class DV >
void doToPersistent1 (DV &, const std::false_type &)
 Convert to persistent form. More...
 
template<class DV >
void doToPersistent (DV &v)
 Convert to persistent form. More...
 
template<class DV >
void doToTransient2 (DV &v, const std::true_type &)
 Convert to transient form. More...
 
template<class DV >
void doToTransient2 (DV &, const std::false_type &)
 Convert to transient form. More...
 
template<class DV >
void doToTransient1 (DV &v, const std::true_type &)
 Convert to persistent form. More...
 
template<class DV >
void doToTransient1 (DV &, const std::false_type &)
 Convert to transient form. More...
 
template<class DV >
void doToTransient (DV &v)
 Convert to persistent form. More...
 

Private Attributes

std::vector< sgkey_tm_persKey
 The persistent form. (sgkey, index) More...
 
std::vector< unsigned int > m_persIndex
 
bool m_clearOnPersistent = false
 If true, the vector should be cleared when doPersistent is called. More...
 

Friends

class ::ViewVectorBaseTest
 

Detailed Description

Hold the persistent representation for a ViewVector.

Base class for ViewVector; not to be used directly.

Definition at line 37 of file ViewVectorBase.h.

Constructor & Destructor Documentation

◆ ~ViewVectorBase()

virtual SG::ViewVectorBase::~ViewVectorBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ clearPersistent()

void SG::ViewVectorBase::clearPersistent ( )

Clear the persistent data.

◆ doToPersistent()

template<class DV >
void SG::ViewVectorBase::doToPersistent ( DV &  v)
protected

Convert to persistent form.

Parameters
vThe vector to convert.

This will abort if called for a class with no CLID.

◆ doToPersistent1() [1/2]

template<class DV >
void SG::ViewVectorBase::doToPersistent1 ( DV &  ,
const std::false_type &   
)
protected

Convert to persistent form.

Parameters
vThe vector to convert.

Called for classes that do not have a CLID. This will simply abort.

◆ doToPersistent1() [2/2]

template<class DV >
void SG::ViewVectorBase::doToPersistent1 ( DV &  v,
const std::true_type &   
)
protected

Convert to persistent form.

Parameters
vThe vector to convert.

Called for classes that have a CLID.

◆ doToTransient()

template<class DV >
void SG::ViewVectorBase::doToTransient ( DV &  v)
inlineprotected

Convert to persistent form.

Parameters
vThe vector to convert.

Dispatch based on whether the class has a CLID.

Definition at line 157 of file ViewVectorBase.h.

158  {
159 #ifdef XAOD_STANDALONE
160  doToTransient1 (v, std::true_type());
161 #else
163 #endif
164  }

◆ doToTransient1() [1/2]

template<class DV >
void SG::ViewVectorBase::doToTransient1 ( DV &  ,
const std::false_type &   
)
inlineprotected

Convert to transient form.

Parameters
vThe vector to fill in.

Called for the case that DV doesn't have a CLID. A no-op.

This is also what will get called for the case of an older version of a schema-evolved vector.

Definition at line 147 of file ViewVectorBase.h.

147 {}

◆ doToTransient1() [2/2]

template<class DV >
void SG::ViewVectorBase::doToTransient1 ( DV &  v,
const std::true_type &   
)
inlineprotected

Convert to persistent form.

Parameters
vThe vector to convert.

Class has a CLID; dispatch based on whether DV is a ConstDataVector.

Definition at line 131 of file ViewVectorBase.h.

132  {
133  doToTransient2 (v, std::is_same<DV, typename DV::base_data_vector>());
134  }

◆ doToTransient2() [1/2]

template<class DV >
void SG::ViewVectorBase::doToTransient2 ( DV &  ,
const std::false_type &   
)
inlineprotected

Convert to transient form.

Parameters
vThe vector to fill in.

Called for the case that DV is not a ConstDataVector. A no-op.

Definition at line 121 of file ViewVectorBase.h.

121 {}

◆ doToTransient2() [2/2]

template<class DV >
void SG::ViewVectorBase::doToTransient2 ( DV &  v,
const std::true_type &   
)
protected

Convert to transient form.

Parameters
vThe vector to fill in.

Called for classes that have a CLID if DV is not a ConstDataVector.

◆ setClearOnPersistent()

void SG::ViewVectorBase::setClearOnPersistent ( )

Set a flag to declare that the vector should be cleared on the next call to toPersistent().

This would be used in the case where we make a copy of the object being written.

◆ toPersistent()

virtual void SG::ViewVectorBase::toPersistent ( )
pure virtual

Convert the vector to persistent form.

Implemented in ViewVector< DV >, and ViewVector< TestBContainer >.

◆ toTransient()

virtual void SG::ViewVectorBase::toTransient ( )
pure virtual

Convert the vector to transient form.

Implemented in ViewVector< DV >, and ViewVector< TestBContainer >.

Friends And Related Function Documentation

◆ ::ViewVectorBaseTest

friend class ::ViewVectorBaseTest
friend

Definition at line 169 of file ViewVectorBase.h.

Member Data Documentation

◆ m_clearOnPersistent

bool SG::ViewVectorBase::m_clearOnPersistent = false
private

If true, the vector should be cleared when doPersistent is called.

Definition at line 176 of file ViewVectorBase.h.

◆ m_persIndex

std::vector<unsigned int> SG::ViewVectorBase::m_persIndex
private

Definition at line 173 of file ViewVectorBase.h.

◆ m_persKey

std::vector<sgkey_t> SG::ViewVectorBase::m_persKey
private

The persistent form. (sgkey, index)

Definition at line 172 of file ViewVectorBase.h.


The documentation for this class was generated from the following file:
SG::ViewVectorBase::doToTransient1
void doToTransient1(DV &v, const std::true_type &)
Convert to persistent form.
Definition: ViewVectorBase.h:131
SG::ViewVectorBase::doToTransient2
void doToTransient2(DV &v, const std::true_type &)
Convert to transient form.
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
python.PyAthena.v
v
Definition: PyAthena.py:154