|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef ATHLINKS_ELEMENTLINKVECTOR_H
8 #define ATHLINKS_ELEMENTLINKVECTOR_H
14 #include <boost/iterator/transform_iterator.hpp>
15 #include <boost/iterator_adaptors.hpp>
17 #include "AthLinks/ElementLinkVectorBase.h"
18 #include "AthLinks/DataLink.h"
19 #include "AthLinks/ElementLink.h"
21 #include "AthLinks/tools/selection_ns.h"
26 template<
class STORABLE >
31 template <
typename DOBJ>
35 template <
typename DOBJ>
61 template <
typename DOBJ>
90 typedef typename std::vector<ElemLinkRef>
RefVector;
107 template <
class Iterator>
109 :
public boost::transform_iterator<Short2LongRef, Iterator>
112 typedef boost::transform_iterator<Short2LongRef, Iterator>
Base;
115 using Base::operator++;
116 using Base::operator--;
126 typedef ELVIterator<typename RefVector::iterator>
iterator;
229 m_persKeys =
vec.m_persKeys;
230 m_persIndices =
vec.m_persIndices;
240 m_persKeys = std::move(
vec.m_persKeys);
241 m_persIndices = std::move(
vec.m_persIndices);
248 template <
class InputIterator>
261 bool toPersistent(std::vector<typename DataLinkVector::size_type>& shortrefs);
327 void push_back (
typename DataLinkVector::size_type nameIndex,
352 template<
typename INDEX_TYPE >
362 std::cout <<
"DUMMY removeHostDObj called for link "
363 << link.dataID() <<
"/" << link.index() << std::endl;
374 typename RefVector::const_iterator
376 typename RefVector::const_iterator ret(
m_shortRefs.begin());
379 std::cout <<
"shortIterFromLong(const version) called for "
380 << longIter->dataID() <<
"/" << longIter->index()
382 <<
" result is " << ret->dataID() <<
"/" << ret->index() << std::endl;
393 std::cout <<
"shortIterFromLong called for "
394 << longIter->dataID() <<
"/" << longIter->index()
396 <<
" result is " << ret->dataID() <<
"/" << ret->index() << std::endl;
403 template <
class InputIterator>
405 template <
class InputIterator>
416 ROOT_SELECTION_NS::ElementLinkVector< DOBJ>::self
DictSel;
420 template <
typename DOBJ>
434 template<
class STORABLE >
448 #include "AthLinks/ElementLinkVector.icc"
453 template <
typename DOBJ>
459 template <
typename DOBJ>
465 template <
typename DOBJ>
471 template <
typename DOBJ>
481 template <
typename DOBJ>
486 std::cout <<
"std::swap called for lhs " << std::hex << &lhs
487 <<
" rhs " << &rhs << std::dec << std::endl;
493 #endif // not __GCCXML__
JetConstituentVector::iterator iterator
ElementLinkVector(size_type n, const ElemLink &link)
bool toPersistent(std::vector< typename DataLinkVector::size_type > &shortrefs)
Base::sgkey_t sgkey_t
Type of hashed keys.
const_reference front() const
void toTransient(uint64_t &dummy)
Function setting up the object for forward indexing types.
const_reference operator[](size_type n) const
DataLinkVector::iterator endHostDObjs()
void push_back(typename DataLinkVector::size_type nameIndex, typename ElemLinkRef::index_type elementIndex)
DataLinkVector::iterator findHostDObj(const ElemLink &link)
find the host of an element. Returns endHostDObjs() if not found
const ElemLink * const_pointer
ElementLinkVector(size_type n)
const_reverse_iterator rbegin() const
const ElemLink operator()(const ElemLinkRef &shortRef) const
ElementLinkVector(int n, const ElemLink &link=ElemLink())
void toTransient(INDEX_TYPE &dummy)
Function taking care of all the other indexing types (no direct ROOT I/O)
Base::ID_type ID_type
Type of string keys.
void moveHostDObjs(DataLinkVector &dobjs)
IndexingPolicy::ElementConstPointer ElementConstPointer
EXIT_ROOT_SELECTION_NS bool operator<(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
ELVIterator< typename RefVector::reverse_iterator > reverse_iterator
ELVIterator< typename RefVector::const_reverse_iterator > const_reverse_iterator
void addHostDObj(const ElemLink &link)
add host of link to list. No duplicates. O(N) in m_hostDObjs
SG::ELVRef< DOBJ > ElemLinkRef
ELVIterator< typename RefVector::iterator > iterator
const DataLinkVector & hostDObjs() const
void insert(iterator position, size_type n, const ElemLink &link)
ElementLink< DOBJ > ElemLink
bool operator==(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
std::vector< size_t > vec
ElementLinkVector(long n, const ElemLink &link=ElemLink())
void insert(iterator position, InputIterator first, InputIterator last)
void swap(ElemLinkVec &vec)
Base class holding the container independent part of ElementLinkVector.
ElementConstPointer elementCPtr(size_type index) const
pointer to an element, given its ElementLinkVector index. O(1)
void push_back(const ElemLink &link)
DataLinkVector::const_iterator findHostDObj(const ElemLink &link) const
find the host of an element. Returns endHostDObjs() if not found
void resize(size_type sz, const ElemLink &link=ElemLink())
const_iterator begin() const
void toTransient(uint32_t &dummy)
size_type capacity() const
const_reverse_iterator rend() const
RefVector::allocator_type allocator_type
a short ref to an ElementLink into an ElementLinkVector. Used to be an internal class of ElementLinkV...
bool operator!=(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_shortRefs
Mark all transient members:
class iterator - iterator over elements in DataLinkVector which manages the Entry objects
RefVector::iterator shortIterFromLong(iterator longIter)
get a short ref iterator from an iterator
DataLinkVector m_hostDObjs
the dobjs hosting our elements. They are all of type DOBJ
ID_type elementDataID(size_type index) const
dataID (long ref) of an element, given its ElementLinkVector index. O(1)
std::vector< DataLink< DOBJ > > DataLinkVector
ElemLink::sgkey_t sgkey_t
bool operator>(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
RefVector::size_type size_type
ELVIterator operator++(int)
ELVIterator< typename RefVector::const_iterator > const_iterator
DataLinkVector::iterator beginHostDObjs()
DataLinkVector::const_iterator beginHostDObjs() const
iterator erase(iterator position)
void removeHostObj(const ElemLink &)
remove host of link from list. O(N) in m_hostDObjs (which is small)
ROOT_SELECTION_NS::ElementLinkVector< DOBJ >::self DictSel
Needed for the simplified Reflex class name.
std::vector< ElemLinkRef > RefVector
the element links stored as ElemLinkRefs for compactness
ElementLinkVector implementation for standalone ROOT.
a functor turning an ElemLinkRef into an ElementLink
ElementLinkVector(const ElemLinkVec &vec)
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_hostDObjs
boost::transform_iterator< Short2LongRef, Iterator > Base
ElementLinkVector(InputIterator first, InputIterator last)
const_reference at(size_type n) const
iterator erase(iterator first, iterator last)
ElemLink::index_type index_type
ElemLink operator()(ElemLinkRef &shortRef) const
void assign(size_type n, const ElemLink &link)
ElementLinkVector< DOBJ > ElemLinkVec
const_reference back() const
RefVector::difference_type difference_type
iterator insert(iterator position, const ElemLink &link)
DataLinkVector::const_iterator endHostDObjs() const
IndexingPolicy::index_type index_type
The index type presented to and returned from the link.
ElementLinkVector< DOBJ > ElemLinkVec
const_iterator end() const
void assign(InputIterator first, InputIterator last)
index_type elementIndex(size_type index) const
host index of an element, given its ElementLinkVector index. O(1)
void reserve(size_type n)
ElementLinkVector(ElemLinkVec &&vec) noexcept
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
size_type max_size() const
ELVIterator operator--(int)
reverse_iterator rbegin()
ELVIterator(const Base &b)
RefVector::const_iterator shortIterFromLong(const_iterator longIter) const
get a short ref iterator from an iterator
ElemLink::index_type index_type
ElementLinkVector & operator=(const ElemLinkVec &vec)
const ElemLink & elementLink() const
get the corresponding ElementLink. O(1)
ElemLink::ElementConstPointer ElementConstPointer
ElemLink::ID_type ID_type