Derived DataVector<T>
.
More...
#include <DataVector.h>
Public Types | |
typedef BASE | DataVector_BASE |
typedef BASE | DVL_BASE |
typedef BASE::PtrVector | PtrVector |
typedef BASE::PtrVector | BaseContainer |
typedef T *& | reference |
typedef T *const & | const_reference |
typedef BASE::size_type | size_type |
typedef BASE::difference_type | difference_type |
typedef T * | value_type |
typedef BASE::allocator_type | allocator_type |
typedef T ** | pointer |
typedef T *const * | const_pointer |
typedef const T * | const_value_type |
typedef T | base_value_type |
typedef DataModel_detail::ElementProxy < DataVector > | ElementProxy |
typedef DataModel_detail::const_iterator < DataVector > | const_iterator |
Standard const_iterator . | |
typedef DataModel_detail::iterator < DataVector > | iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
Standard const_reverse_iterator . | |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef DataVector< T, BASE > | self |
A helper typedef. | |
Public Member Functions | |
void | resize (size_type sz) |
void | shrink_to_fit () |
void | pop_back () |
void | clear () |
void | clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES) |
Constructors, destructors, assignment. | |
DataVector (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES) | |
Default constructor. | |
DataVector (size_type n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES) | |
Sized constructor. | |
template<class InputIterator > | |
DataVector (InputIterator first, InputIterator last, SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS, SG::IndexTrackingPolicy trackIndices=SG::DEFAULT_TRACK_INDICES, SG::IAuxStore *store=0) | |
Copy constructor. | |
DataVector & | operator= (const DataVector &rhs) |
Assignment operator. | |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
Assign from iterators. | |
Size and capacity. | |
size_type | size () const |
Returns the number of elements in the collection. | |
void | resize (size_type sz) |
Resizes the collection to the specified number of elements. | |
void | reserve (size_type n) |
Attempt to preallocate enough memory for a specified number of elements. | |
size_type | max_size () const |
Returns the size() of the largest possible collection. | |
size_type | capacity () const |
Returns the total number of elements that the collection can hold before needing to allocate more memory. | |
bool | empty () const |
Returns true if the collection is empty. | |
Element access. | |
const T * | operator[] (size_type n) const |
Access an element, as an rvalue. | |
const T * | get (size_type n) const |
Access an element, as an rvalue. | |
ElementProxy | operator[] (size_type n) |
Access an element, as an lvalue. | |
const T * | at (size_type n) const |
Access an element, as an rvalue. | |
ElementProxy | at (size_type n) |
Access an element, as an lvalue. | |
const T * | front () const |
Access the first element in the collection as an rvalue. | |
const T * | back () const |
Access the last element in the collection as an rvalue. | |
ElementProxy | front () |
Access the first element in the collection as an lvalue. | |
ElementProxy | back () |
Access the last element in the collection as an lvalue. | |
Iterator creation. | |
const_iterator | begin () const |
Return a const_iterator pointing at the beginning of the collection. | |
const_iterator | end () const |
Return a const_iterator pointing past the end of the collection. | |
iterator | begin () |
Return an iterator pointing at the beginning of the collection. | |
iterator | end () |
Return an iterator pointing past the end of the collection. | |
const_reverse_iterator | rbegin () const |
Return a const_reverse_iterator pointing past the end of the collection. | |
const_reverse_iterator | rend () const |
Return a const_reverse_iterator pointing at the beginning of the collection. | |
reverse_iterator | rbegin () |
Return a reverse_iterator pointing past the end of the collection. | |
reverse_iterator | rend () |
Return a reverse_iterator pointing at the beginning of the collection. | |
const_iterator | cbegin () const |
Return a const_iterator pointing at the beginning of the collection. | |
const_iterator | cend () const |
Return a const_iterator pointing past the end of the collection. | |
const_reverse_iterator | crbegin () const |
Return a const_reverse_iterator pointing past the end of the collection. | |
const_reverse_iterator | crend () const |
Return a const_reverse_iterator pointing at the beginning of the collection. | |
Insertion operations. | |
void | push_back (value_type pElem) |
Add an element to the end of the collection. | |
void | emplace_back (value_type pElem) |
Add an element to the end of the collection. | |
iterator | insert (iterator position, value_type pElem) |
Add a new element to the collection. | |
iterator | emplace (iterator position, value_type pElem) |
Add a new element to the collection. | |
template<class InputIterator > | |
void | insert (iterator position, InputIterator first, InputIterator last) |
Add a group of new elements to the collection. | |
Erasure operations. | |
iterator | erase (iterator position) |
Remove element at a given position. | |
iterator | erase (iterator first, iterator last) |
Remove a range of elements. | |
void | pop_back () |
Remove the last element from the collection. | |
void | clear () |
Erase all the elements in the collection. | |
Public Attributes | |
ROOT_SELECTION_NS::MemberAttributes < kTransient > | m_isMostDerived |
Automatically generate dictionary for contained vector. | |
Static Public Attributes | |
static const bool | has_virtual = BASE::has_virtual |
Internal operations. | |
| |
class | DataModel_detail::ElementProxy< DataVector > |
class | ConstDataVector< DataVector > |
void | test2_assignelement1 () |
void | test2_assignelement2 () |
void | resortAux (iterator beg, iterator end) |
Reset indices / reorder aux data after elements have been permuted. | |
void | testInsert (const char *op) |
Test if we can insert; raise an exception if not. | |
void | testInsertOol (const char *op) |
Test if we can insert; raise an exception if not. | |
static int | baseOffset1 (const char *p, const DataVector &dv, const std::type_info &ti) |
Helper for baseOffset . | |
static const T * | do_cast (const typename PtrVector::value_type p) |
Helper to shorten calls to DataModel_detail::DVLCast . | |
void | clearMostDerived () |
Clear m_isMostDerived for this instance and for all bases. | |
virtual void | setMostDerived () |
Set m_isMostDerived for this instance and clear it for all bases. | |
Swap and sort. | |
| |
void | swap (DataVector &rhs) |
Swap this collection with another. | |
void | sort () |
Sort the container. | |
template<class COMPARE > | |
void | sort (COMPARE comp) |
Sort the container with a user-specified comparison operator. | |
static void | iter_swap (iterator a, iterator b) |
Swap the referents of two DataVector iterators. | |
Non-standard operations. | |
| |
void | swapElement (size_type index, value_type newElem, reference oldElem) |
Swap one element out of the container. | |
void | swapElement (iterator pos, value_type newElem, reference oldElem) |
Swap one element out of the container. | |
void | clear (SG::OwnershipPolicy ownPolicy) |
Erase all the elements in the collection, and reset the ownership mode. | |
void | clear (SG::OwnershipPolicy ownPolicy, SG::IndexTrackingPolicy trackIndices) |
Erase all the elements in the collection, and reset the ownership mode. | |
virtual const DataModel_detail::DVLInfoBase & | dvlinfo_v () const |
Return the DV/DL info struct for this class. | |
const SG::AuxVectorBase & | auxbase () const |
Convert to AuxVectorBase . | |
const PtrVector & | stdcont () const |
Return the underlying std::vector of the container. | |
SG::OwnershipPolicy | ownPolicy () const |
Return the ownership policy setting for this container. | |
static const DataModel_detail::DVLInfoBase & | dvlinfo () |
Return the DV/DL info struct for this class. | |
static int | baseOffset (const std::type_info &ti) |
Return the offset of a base DataVector class. |
Derived DataVector<T>
.
This is used for the case where T
derives from other classes. The vector of pointers is actually held in the (unique) base class of the hierarchy.
See the file comments for full details.
typedef T DataVector< T, BASE >::base_value_type |
The T
value used as the template parameter. Note that this is different from value_type
(that's T*
).
typedef DataModel_detail::ElementProxy<DataVector> DataVector< T, BASE >::ElementProxy |
This type is used to proxy lvalue accesses to DataVector
elements, in order to handle ownership.
typedef DataModel_detail::iterator<DataVector> DataVector< T, BASE >::iterator |
Standard iterator
. Note that lvalue references here will yield an ElementProxy
, not a reference
.
typedef BASE::PtrVector DataVector< T, BASE >::PtrVector |
This is the type of the underlying std::vector
(what stdcont
returns).
Reimplemented in DataVector_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataVector_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataVector_detail::VirtBases< B1, B2, B3 >.
typedef std::reverse_iterator<iterator> DataVector< T, BASE >::reverse_iterator |
Standard reverse_iterator
. Note that lvalue references here will yield an ElementProxy
, not a reference
.
EXIT_ROOT_SELECTION_NS DataVector< T, BASE >::DataVector | ( | SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS , |
|
SG::IndexTrackingPolicy | trackIndices = SG::DEFAULT_TRACK_INDICES | |||
) | [inline, explicit] |
Default constructor.
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. |
By default, a DataVector
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. |
By default, a DataVector
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataVector class.
DataVector< T, BASE >::DataVector | ( | size_type | n, | |
SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS , |
|||
SG::IndexTrackingPolicy | trackIndices = SG::DEFAULT_TRACK_INDICES | |||
) | [inline, explicit] |
Sized constructor.
n | The size of the container. | |
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. |
Note that unlike the standard vector constructor, you can't specify an initial value here. The container will be initialized with 0's.
By default, a DataVector
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
n | The size of the container. | |
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. |
Note that unlike the standard vector constructor, you can't specify an initial value here. The container will be initialized with 0's.
By default, a DataVector
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataVector class.
DataVector< T, BASE >::DataVector | ( | InputIterator | first, | |
InputIterator | last, | |||
SG::OwnershipPolicy | ownPolicy = SG::VIEW_ELEMENTS , |
|||
SG::IndexTrackingPolicy | trackIndices = SG::DEFAULT_TRACK_INDICES , |
|||
SG::IAuxStore * | store = 0 | |||
) | [inline] |
Copy constructor.
Constructor from iterators.
rhs | The container from which to copy. |
This is a `shallow' copy; the new container will not own its elements. 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. | |
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. | |
store | An associated auxiliary data store. |
By default, a DataVector
will own its elements (and take ownership of the pointers passed to this constructor). To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
first | The start of the range to put in the new container. | |
last | The end of the range to put in the new container. | |
ownPolicy | The ownership mode for the container. | |
trackIndices | The index tracking policy. | |
store | An associated auxiliary data store. |
By default, a DataVector
will own its elements (and take ownership of the pointers passed to this constructor). To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataVector class.
void DataVector< T, BASE >::assign | ( | InputIterator | first, | |
InputIterator | last | |||
) | [inline] |
Assign from iterators.
first | The start of the range to put in the container. | |
last | The end of the range to put in the container. |
Any existing owned elements will be released. The DataVector's
ownership policy determines whether it will take ownership of the new elements.
DataVector< T, BASE >::ElementProxy DataVector< T, BASE >::at | ( | size_type | n | ) | [inline] |
Access an element, as an lvalue.
n | Array index to access. |
Will raise std::out_of_range
if the index is out-of-bounds. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
const T * DataVector< T, BASE >::at | ( | size_type | n | ) | const [inline] |
Access an element, as an rvalue.
n | Array index to access. |
Will raise std::out_of_range
if the index is out-of-bounds. Note that we return a const
T*
rather than a reference.
const SG::AuxVectorBase & DataVector< T, BASE >::auxbase | ( | ) | const [inline] |
Convert to AuxVectorBase
.
Needed to get AuxVectorBase from a ConstDataVector
. Present in DataVector
as well for consistency. We only really need it in the base class; however, root6 fails constructing a TMethodCall
for this if there is virtual derivation. A workaround is to redeclare this in the derived classes too.
DataVector< T, BASE >::ElementProxy DataVector< T, BASE >::back | ( | ) | [inline] |
Access the last element in the collection as an lvalue.
No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
const T * DataVector< T, BASE >::back | ( | ) | const [inline] |
Access the last element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const
T*
rather than a reference.
int DataVector< T, BASE >::baseOffset | ( | const std::type_info & | ti | ) | [inline, static] |
Return the offset of a base DataVector
class.
ti | std::type_info of the desired class. |
If ti
represents a DataVector
base class of this one, then return the offset of that base class. Otherwise, return -1.
This function is here due to limitations of root 6, which can't calculate these offsets correctly from the dictionary if virtual derivation is used.
int DataVector< T, BASE >::baseOffset1 | ( | const char * | p, | |
const DataVector< T, BASE > & | dv, | |||
const std::type_info & | ti | |||
) | [inline, static] |
Helper for baseOffset
.
p | Pointer to the start of the top-level object. | |
dv | Reference to the DataVector object. | |
ti | std::type_info of the desired class. |
If ti
represents a DataVector
base class of this one, then return the offset of that base class. Otherwise, return -1.
DataVector< T, BASE >::iterator DataVector< T, BASE >::begin | ( | ) | [inline] |
Return an iterator
pointing at the beginning of the collection.
iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataVector< T, BASE >::const_iterator DataVector< T, BASE >::begin | ( | ) | const [inline] |
Return a const_iterator
pointing at the beginning of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataVector< T, BASE >::const_iterator DataVector< T, BASE >::cbegin | ( | ) | const [inline] |
Return a const_iterator
pointing at the beginning of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataVector< T, BASE >::const_iterator DataVector< T, BASE >::cend | ( | ) | const [inline] |
Return a const_iterator
pointing past the end of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
void DataVector< T, BASE >::clear | ( | SG::OwnershipPolicy | ownPolicy, | |
SG::IndexTrackingPolicy | trackIndices | |||
) | [inline] |
Erase all the elements in the collection, and reset the ownership mode.
ownPolicy | The new ownership policy of the container. | |
trackIndices | The index tracking policy. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
void DataVector< T, BASE >::clear | ( | SG::OwnershipPolicy | ownPolicy | ) | [inline] |
Erase all the elements in the collection, and reset the ownership mode.
ownPolicy | The new ownership policy of the container. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
void DataVector< T, BASE >::clear | ( | ) | [inline] |
Erase all the elements in the collection.
Erase all the elements in the collection, and reset the ownership mode.
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
ownPolicy | The new ownership policy of the container. | |
trackIndices | The index tracking policy. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
void DataVector< T, BASE >::clearMostDerived | ( | ) | [inline, protected] |
Clear m_isMostDerived
for this instance and for all bases.
Called from the constructor after setting m_isMostDerived
.
Reimplemented in DataVector_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataVector_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataVector_detail::VirtBases< B1, B2, B3 >.
DataVector< T, BASE >::const_reverse_iterator DataVector< T, BASE >::crbegin | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing past the end of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataVector< T, BASE >::const_reverse_iterator DataVector< T, BASE >::crend | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing at the beginning of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
const T * DataVector< T, BASE >::do_cast | ( | const typename PtrVector::value_type | p | ) | [inline, static] |
Helper to shorten calls to DataModel_detail::DVLCast
.
Helper to shorten calls to DataVector_detail::DVLCast
.
p | The value to convert. |
const
T*
.The conversion will be done with static_cast
if possible, with dynamic_cast
otherwise.
const DataModel_detail::DVLInfoBase & DataVector< T, BASE >::dvlinfo | ( | ) | [inline, static] |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
const DataModel_detail::DVLInfoBase & DataVector< T, BASE >::dvlinfo_v | ( | ) | const [inline, virtual] |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
Reimplemented in DataVector_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataVector_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataVector_detail::VirtBases< B1, B2, B3 >.
DataVector< T, BASE >::iterator DataVector< T, BASE >::emplace | ( | iterator | position, | |
value_type | pElem | |||
) | [inline] |
Add a new element to the collection.
position | Iterator before which the element will be added. | |
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
For DataVector
, this is just the same as insert
. It's included just for interface compatibility with `stdvector`.
void DataVector< T, BASE >::emplace_back | ( | value_type | pElem | ) | [inline] |
Add an element to the end of the collection.
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
For DataVector
, this is just the same as push_back
. It's included just for interface compatibility with `stdvector`.
DataVector< T, BASE >::iterator DataVector< T, BASE >::end | ( | ) | [inline] |
Return an iterator
pointing past the end of the collection.
iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataVector< T, BASE >::const_iterator DataVector< T, BASE >::end | ( | ) | const [inline] |
Return a const_iterator
pointing past the end of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataVector< T, BASE >::iterator DataVector< T, BASE >::erase | ( | iterator | first, | |
iterator | last | |||
) | [inline] |
Remove a range of elements.
first | Iterator pointing to the first element to be removed. | |
last | Iterator pointing one past the last element to be removed. |
end()
).If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
Reimplemented in xAOD::MissingETAssociationMap_v1, and xAOD::MissingETComponentMap_v1.
DataVector< T, BASE >::iterator DataVector< T, BASE >::erase | ( | iterator | position | ) | [inline] |
Remove element at a given position.
position | Iterator pointing to the element to be removed. |
end()
).If the container owns its elements, then the pointed-to element will be deleted.
Reimplemented in xAOD::MissingETAssociationMap_v1, and xAOD::MissingETComponentMap_v1.
DataVector< T, BASE >::ElementProxy DataVector< T, BASE >::front | ( | ) | [inline] |
Access the first element in the collection as an lvalue.
No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
const T * DataVector< T, BASE >::front | ( | ) | const [inline] |
Access the first element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const
T*
rather than a reference.
const T * DataVector< T, BASE >::get | ( | size_type | n | ) | const [inline] |
Access an element, as an rvalue.
n | Array index to access. |
This is a synonym for operator[] const, to be used when calling from root (where we can't readily call just the const version of a method).
void DataVector< T, BASE >::insert | ( | iterator | position, | |
InputIterator | first, | |||
InputIterator | last | |||
) | [inline] |
Add a group of new elements to the collection.
position | Iterator before which the element will be added. | |
first | The start of the range to put in the container. | |
last | The end of the range to put in the container. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
DataVector< T, BASE >::iterator DataVector< T, BASE >::insert | ( | iterator | position, | |
value_type | pElem | |||
) | [inline] |
Add a new element to the collection.
position | Iterator before which the element will be added. | |
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
void DataVector< T, BASE >::iter_swap | ( | iterator | a, | |
iterator | b | |||
) | [inline, static] |
Swap the referents of two DataVector
iterators.
a | The first iterator for the swap. | |
b | The second iterator for the swap/ |
DataVector< T, BASE > & DataVector< T, BASE >::operator= | ( | const DataVector< T, BASE > & | rhs | ) | [inline] |
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.
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.
DataVector< T, BASE >::ElementProxy DataVector< T, BASE >::operator[] | ( | size_type | n | ) | [inline] |
Access an element, as an lvalue.
n | Array index to access. |
No bounds checking is done. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
const T * DataVector< T, BASE >::operator[] | ( | size_type | n | ) | const [inline] |
Access an element, as an rvalue.
n | Array index to access. |
No bounds checking is done. Note that we return a const
T*
rather than a reference.
void DataVector< T, BASE >::pop_back | ( | ) | [inline] |
Remove the last element from the collection.
If the container owns its elements, then the removed element will be deleted.
void DataVector< T, BASE >::push_back | ( | value_type | pElem | ) | [inline] |
Add an element to the end of the collection.
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
DataVector< T, BASE >::reverse_iterator DataVector< T, BASE >::rbegin | ( | ) | [inline] |
Return a reverse_iterator
pointing past the end of the collection.
reverse_iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataVector< T, BASE >::const_reverse_iterator DataVector< T, BASE >::rbegin | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing past the end of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataVector< T, BASE >::reverse_iterator DataVector< T, BASE >::rend | ( | ) | [inline] |
Return a reverse_iterator
pointing at the beginning of the collection.
reverse_iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataVector< T, BASE >::const_reverse_iterator DataVector< T, BASE >::rend | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing at the beginning of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
void DataVector< T, BASE >::reserve | ( | size_type | n | ) | [inline] |
Attempt to preallocate enough memory for a specified number of elements.
n | Number of elements required. |
void DataVector< T, BASE >::resize | ( | size_type | sz | ) | [inline] |
Resizes the collection to the specified number of elements.
sz | The new size of the collection. |
Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.
If the container is shrunk, elements will be deleted as with erase()
.
void DataVector< T, BASE >::resortAux | ( | iterator | beg, | |
iterator | end | |||
) | [inline] |
Reset indices / reorder aux data after elements have been permuted.
beg | Start of the range of elements to process. | |
end | End of the range of elements to process. |
Call this after some operation that has permuted the elements in the container (such as sort). The index information in the elements will be used to permute all auxiliary data in the same way. Finally, all the indices will be reset in the correct order.
void DataVector< T, BASE >::setMostDerived | ( | ) | [inline, protected, virtual] |
Set m_isMostDerived
for this instance and clear it for all bases.
Called from testInsert
if the test fails. The flag may not have been set if this container was made via copy construction, so set it appropriately now so we can test again.
Reimplemented in DataVector_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataVector_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataVector_detail::VirtBases< B1, B2, B3 >.
DataVector< T, BASE >::size_type DataVector< T, BASE >::size | ( | ) | const [inline] |
Returns the number of elements in the collection.
Could in principle be inherited from the base class, but redeclared in the derived class to avoid root6 bugs.
void DataVector< T, BASE >::sort | ( | COMPARE | comp | ) | [inline] |
Sort the container with a user-specified comparison operator.
comp | Functional to compare two values. |
Reimplemented in xAOD::MissingETAssociationMap_v1, and xAOD::MissingETComponentMap_v1.
void DataVector< T, BASE >::sort | ( | ) | [inline] |
Sort the container.
This just sorts by pointer value, so it's probably not very useful.
Reimplemented in xAOD::MissingETAssociationMap_v1, and xAOD::MissingETComponentMap_v1.
const PtrVector & DataVector< T, BASE >::stdcont | ( | ) | const |
Return the underlying std::vector
of the container.
std::vector
actually holding the collection.Note that DataVector<T>::stdcont
does not necessarily return a std::vector<T*>
if DataVector
inheritance is being used.
void DataVector< T, BASE >::swap | ( | DataVector< T, BASE > & | rhs | ) | [inline] |
Swap this collection with another.
rhs | The collection with which to swap. |
Ownership is swapped along with the collection content.
Note: this method may only be called using the most-derived DataVector
in the hierarchy. The rhs must also be referenced using the most-derived DataVector
.
rhs | The collection with which to swap. |
Ownership is swapped along with the collection content.
Note: this method may only be called using the most-derived DataVector
in the hierarchy. The rhs must also be referenced using the most-derived DataVector
.
Warning: If this container has auxiliary data, then this is an O(N) operation, not O(1).
void DataVector< T, BASE >::swapElement | ( | iterator | pos, | |
value_type | newElem, | |||
reference | oldElem | |||
) | [inline] |
Swap one element out of the container.
pos | The element in the container to swap. | |
newElem | New element to put in the container. May be 0. | |
oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem
. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataList
in the hierarchy.
pos | The element in the container to swap. | |
newElem | New element to put in the container. May be 0. | |
oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem
. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
void DataVector< T, BASE >::swapElement | ( | size_type | index, | |
value_type | newElem, | |||
reference | oldElem | |||
) | [inline] |
Swap one element out of the container.
index | Index of the element in the container to swap. | |
newElem | New element to put in the container. May be 0. | |
oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to newElem
. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
index | Index of the element in the container to swap. | |
newElement | New element to put in the container. May be 0. | |
oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element index of the collection (no bounds checking). Then element index is set to . If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataVector
in the hierarchy.
void DataVector< T, BASE >::testInsert | ( | const char * | op | ) | [inline] |
Test if we can insert; raise an exception if not.
op | Description of the attempted operation. |
In order to maintain type-safety, we can only allow insertions using the most-derived instance of DataVector
. This checks this by testing the m_isMostDerived
, which is set by the constructors to true only for the most-derived instance. If the test fails, we call to potentially out-of-line code to continue.
void DataVector< T, BASE >::testInsertOol | ( | const char * | op | ) | [inline] |
Test if we can insert; raise an exception if not.
op | Description of the attempted operation. |
This continues the test of testInsert
. There is one case where m_isMostDerived
may not be set correctly. If this container was made via copy construction, then all the m_isMostDerived
flags will be false. So we call setMostDerived
to set the flags correctly and test again. If the test fails again, then we raise an exception.
const bool DataVector< T, BASE >::has_virtual = BASE::has_virtual [inline, static] |
This is true for any DataVector
class if we need to use virtual derivation to get to the base DataVector
class.
Reimplemented in DataVector_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataVector_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataVector_detail::VirtBases< B1, B2, B3 >.
ROOT_SELECTION_NS::MemberAttributes< kTransient > DataVector< T, BASE >::m_isMostDerived |
Automatically generate dictionary for contained vector.
Declare the automatically created variable transient