ATLAS Offline Software
|
Identify view containers to be made persistent. More...
#include <ViewVector.h>
Public Types | |
typedef DV::size_type | size_type |
Basic types, forwarded from the base. More... | |
typedef DV::difference_type | difference_type |
typedef DV::allocator_type | allocator_type |
typedef DV::base_value_type | base_value_type |
typedef DV::BaseContainer | BaseContainer |
typedef DV::DVL_BASE | DVL_BASE |
typedef DV::const_iterator | const_iterator |
typedef DV::const_reverse_iterator | const_reverse_iterator |
typedef DV::value_type | value_type |
typedef DV::const_value_type | const_value_type |
typedef DV::reference | reference |
typedef DV::const_reference | const_reference |
typedef DV::pointer | pointer |
typedef DV::const_pointer | const_pointer |
typedef DV::unique_type | unique_type |
typedef std::vector< ElementLink< DV > > | Pers_t |
The old persistent form of this class. More... | |
Public Member Functions | |
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... | |
Static Public Attributes | |
static constexpr bool | must_own = DV::must_own |
If true, then this type must own its contents. 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_t > | m_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... | |
Constructors, destructors, assignment. | |
ViewVector (SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS) | |
Default constructor. More... | |
ViewVector (size_type n, SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS) | |
Sized constructor. More... | |
template<class InputIterator > | |
ViewVector (InputIterator first, InputIterator last) | |
Constructor from iterators. More... | |
ViewVector (const ViewVector &)=default | |
Use the compiler-generated copy constructor. More... | |
ViewVector (ViewVector &&rhs) | |
Move constructor. More... | |
ViewVector (const DV &rhs) | |
Constructor from base vector. More... | |
ViewVector (DV &&rhs) | |
Move constructor from base vector. More... | |
ViewVector (std::initializer_list< value_type > l) | |
Constructor from an initializer list. More... | |
ViewVector & | operator= (const ViewVector &rhs)=default |
Can use compiler-generated assignment op. More... | |
ViewVector & | operator= (const DV &rhs) |
Assignment operator. More... | |
ViewVector & | operator= (ViewVector &&rhs) |
Move assignment. More... | |
ViewVector & | operator= (DV &&rhs) |
Move assignment from base vector. More... | |
ViewVector & | operator= (std::initializer_list< value_type > l) |
Assignment operator, from an initializer list. More... | |
void | clear (SG::OwnershipPolicy ownPolicy) |
void | clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices) |
virtual void | toPersistent () override |
Convert the vector to persistent form. More... | |
virtual void | toTransient () override |
Convert the vector to transient form. More... | |
void | registerBaseInit () |
Helper to ensure that the inheritance information for this class gets initialized. More... | |
Identify view containers to be made persistent.
This is a variant of DataVector
that can only be constructed as a view vector. This class also holds the persistent representation of the view vector, which is logically equivalent to a std::vector<ElementLink<DV>
> (but stored as vector of pairs of integers).
The template parameter DV
is the DataVector
on which the view is based. ViewVector<DV>
acts just like DV
except that it will throw an exception if you try to construct it as an owning container. (The ownership mode arguments cannot really be removed from the methods completely, otherwise ConstDataVector<ViewVector<DV> > wouldn't compile.)
To make a ViewVector<DV>
object persistent:
CLASS_DEF
, to associate a CLID with the object, use VIEWVECTOR_CLASS_DEF
. You can then record a ViewVector
to StoreGate without the VIEWVECTOR_CLASS_DEF
being present in the compilation unit doing the record. You can also record a ViewVector
object using a pointer to the base DataVector
. These behaviors can be useful when the ViewVector
type is generated by templated code. (Currently, this will only work directly if the argument to the ViewVector
class is a DataVector
directly, rather than an intermediate class.)ViewVector
were saved directly as std::vector<ElementLink<DV>
>. If you need to continue to read such data, then generate a dictionary for std::vector<ElementLink<DV>
> along with a guid. (You can use the Pers_t
typedef in ViewVector
to help with this.)toPersistent()
on the ViewVector
object prior to calling Fill()
on the tree. Definition at line 65 of file ViewVector.h.
typedef DV::allocator_type ViewVector< DV >::allocator_type |
Definition at line 72 of file ViewVector.h.
typedef DV::base_value_type ViewVector< DV >::base_value_type |
Definition at line 73 of file ViewVector.h.
typedef DV::BaseContainer ViewVector< DV >::BaseContainer |
Definition at line 74 of file ViewVector.h.
typedef DV::const_iterator ViewVector< DV >::const_iterator |
Definition at line 76 of file ViewVector.h.
typedef DV::const_pointer ViewVector< DV >::const_pointer |
Definition at line 83 of file ViewVector.h.
typedef DV::const_reference ViewVector< DV >::const_reference |
Definition at line 81 of file ViewVector.h.
typedef DV::const_reverse_iterator ViewVector< DV >::const_reverse_iterator |
Definition at line 77 of file ViewVector.h.
typedef DV::const_value_type ViewVector< DV >::const_value_type |
Definition at line 79 of file ViewVector.h.
typedef DV::difference_type ViewVector< DV >::difference_type |
Definition at line 71 of file ViewVector.h.
typedef DV::DVL_BASE ViewVector< DV >::DVL_BASE |
Definition at line 75 of file ViewVector.h.
typedef std::vector<ElementLink<DV> > ViewVector< DV >::Pers_t |
The old persistent form of this class.
Definition at line 91 of file ViewVector.h.
typedef DV::pointer ViewVector< DV >::pointer |
Definition at line 82 of file ViewVector.h.
typedef DV::reference ViewVector< DV >::reference |
Definition at line 80 of file ViewVector.h.
typedef DV::size_type ViewVector< DV >::size_type |
Basic types, forwarded from the base.
Definition at line 70 of file ViewVector.h.
typedef DV::unique_type ViewVector< DV >::unique_type |
Definition at line 84 of file ViewVector.h.
typedef DV::value_type ViewVector< DV >::value_type |
Definition at line 78 of file ViewVector.h.
|
explicit |
Default constructor.
ownPolicy | The ownership mode for the container. Must be SG::VIEW_ELEMENTS . (Argument present only for interface compatibility.) |
|
explicit |
Sized constructor.
n | The size of the container. |
ownPolicy | The ownership mode for the container. Must be SG::VIEW_ELEMENTS . (Argument present only for interface compatibility.) |
Note that unlike the standard vector constructor, you can't specify an initial value here. The container will be initialized with 0's.
ViewVector< DV >::ViewVector | ( | InputIterator | first, |
InputIterator | last | ||
) |
Constructor from iterators.
first | The start of the range to put in the new container. |
last | The end of the range to put in the new container. |
|
default |
Use the compiler-generated copy constructor.
ViewVector< DV >::ViewVector | ( | ViewVector< DV > && | rhs | ) |
Move constructor.
rhs | The container from which to move. |
Any auxiliary data will be moved along with the container contents.
ViewVector< DV >::ViewVector | ( | const DV & | rhs | ) |
Constructor from base vector.
rhs | The container from which to copy. |
ViewVector< DV >::ViewVector | ( | DV && | rhs | ) |
Move constructor from base vector.
rhs | The container from which to copy. Must be a view container. |
Any auxiliary data will be moved along with the container contents.
ViewVector< DV >::ViewVector | ( | std::initializer_list< value_type > | l | ) |
Constructor from an initializer list.
l | An initializer list. |
void ViewVector< DV >::clear | ( | SG::OwnershipPolicy | ownPolicy | ) |
void ViewVector< DV >::clear | ( | SG::OwnershipPolicy | ownPolicy, |
SG::IndexTrackingPolicy | trackIndices | ||
) |
|
inherited |
Clear the persistent data.
|
protectedinherited |
Convert to persistent form.
v | The vector to convert. |
This will abort if called for a class with no CLID.
|
protectedinherited |
Convert to persistent form.
v | The vector to convert. |
Called for classes that do not have a CLID. This will simply abort.
|
protectedinherited |
Convert to persistent form.
v | The vector to convert. |
Called for classes that have a CLID.
|
inlineprotectedinherited |
Convert to persistent form.
v | The vector to convert. |
Dispatch based on whether the class has a CLID.
Definition at line 157 of file ViewVectorBase.h.
|
inlineprotectedinherited |
Convert to transient form.
v | The 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.
|
inlineprotectedinherited |
Convert to persistent form.
v | The vector to convert. |
Class has a CLID; dispatch based on whether DV is a ConstDataVector.
Definition at line 131 of file ViewVectorBase.h.
|
inlineprotectedinherited |
Convert to transient form.
v | The 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.
|
protectedinherited |
Convert to transient form.
v | The vector to fill in. |
Called for classes that have a CLID if DV is not a ConstDataVector.
ViewVector& ViewVector< DV >::operator= | ( | const DV & | rhs | ) |
Assignment operator.
rhs | The DataVector from which to assign. |
This is a ‘shallow’ copy; after the completion of this, the DataVector will not own its elements. Any elements it owned prior to this call will be released.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
|
default |
Can use compiler-generated assignment op.
ViewVector& ViewVector< DV >::operator= | ( | DV && | rhs | ) |
Move assignment from base vector.
rhs | The container from which to move. Must be a view vector. |
Any auxiliary data will be moved along with the container contents.
ViewVector& ViewVector< DV >::operator= | ( | std::initializer_list< value_type > | l | ) |
Assignment operator, from an initializer list.
l | An initializer list. |
This is equivalent to assign
.
ViewVector& ViewVector< DV >::operator= | ( | ViewVector< DV > && | rhs | ) |
Move assignment.
rhs | The container from which to move. |
Any auxiliary data will be moved along with the container contents.
|
private |
Helper to ensure that the inheritance information for this class gets initialized.
|
inherited |
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.
|
overridevirtual |
Convert the vector to persistent form.
Implements SG::ViewVectorBase.
|
overridevirtual |
Convert the vector to transient form.
Implements SG::ViewVectorBase.
|
privateinherited |
If true, the vector should be cleared when doPersistent is called.
Definition at line 176 of file ViewVectorBase.h.
|
privateinherited |
Definition at line 173 of file ViewVectorBase.h.
|
privateinherited |
The persistent form. (sgkey, index)
Definition at line 172 of file ViewVectorBase.h.
|
staticconstexpr |
If true, then this type must own its contents.
Definition at line 88 of file ViewVector.h.