|
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>
16 #include <RootMetaSelection.h>
18 #include "AthLinks/ElementLinkVectorBase.h"
19 #include "AthLinks/DataLink.h"
20 #include "AthLinks/ElementLink.h"
23 #include "GaudiKernel/MsgStream.h"
27 namespace ROOT {
namespace Meta {
namespace Selection {
28 template<
class STORABLE >
33 template <
typename DOBJ>
37 template <
typename DOBJ>
63 template <
typename DOBJ>
92 typedef typename std::vector<ElemLinkRef>
RefVector;
109 template <
class Iterator>
111 :
public boost::transform_iterator<Short2LongRef, Iterator>
114 typedef boost::transform_iterator<Short2LongRef, Iterator>
Base;
117 using Base::operator++;
118 using Base::operator--;
128 typedef ELVIterator<typename RefVector::iterator>
iterator;
250 template <
class InputIterator>
263 bool toPersistent(std::vector<typename DataLinkVector::size_type>& shortrefs);
329 void push_back (
typename DataLinkVector::size_type nameIndex,
354 template<
typename INDEX_TYPE >
364 std::cout <<
"DUMMY removeHostDObj called for link "
365 << link.dataID() <<
"/" << link.index() << std::endl;
376 typename RefVector::const_iterator
378 typename RefVector::const_iterator ret(
m_shortRefs.begin());
381 std::cout <<
"shortIterFromLong(const version) called for "
382 << longIter->dataID() <<
"/" << longIter->index()
384 <<
" result is " << ret->dataID() <<
"/" << ret->index() << std::endl;
395 std::cout <<
"shortIterFromLong called for "
396 << longIter->dataID() <<
"/" << longIter->index()
398 <<
" result is " << ret->dataID() <<
"/" << ret->index() << std::endl;
405 template <
class InputIterator>
407 template <
class InputIterator>
422 template <
typename DOBJ>
434 namespace ROOT {
namespace Meta {
namespace Selection {
436 template<
class STORABLE >
441 ROOT::Meta::Selection::MemberAttributes< kTransient >
m_shortRefs;
442 ROOT::Meta::Selection::MemberAttributes< kTransient >
m_hostDObjs;
450 #include "AthLinks/ElementLinkVector.icc"
455 template <
typename DOBJ>
461 template <
typename DOBJ>
467 template <
typename DOBJ>
473 template <
typename DOBJ>
483 template <
typename DOBJ>
488 std::cout <<
"std::swap called for lhs " << std::hex << &lhs
489 <<
" rhs " << &rhs << std::dec << std::endl;
495 #endif // not __GCCXML__
JetConstituentVector::iterator iterator
DataLinkVector::const_iterator endHostDObjs() const
ELVIterator(const Base &b)
ElementLinkVector(const ElemLinkVec &vec)
DataLinkVector::const_iterator beginHostDObjs() const
ELVIterator< typename RefVector::iterator > iterator
Base::sgkey_t sgkey_t
Type of hashed keys.
size_type capacity() const
ELVIterator< typename RefVector::reverse_iterator > reverse_iterator
singleton-like access to IMessageSvc via open function and helper
std::vector< uint32_t > m_persIndices
Indices of the referenced objects in the containers.
reverse_iterator rbegin()
void moveHostDObjs(DataLinkVector &dobjs)
boost::transform_iterator< Short2LongRef, Iterator > Base
ELVIterator< typename RefVector::const_iterator > const_iterator
ElementLinkVector(size_type n, const ElemLink &link)
void assign(InputIterator first, InputIterator last)
ELVIterator operator++(int)
Base::ID_type ID_type
Type of string keys.
ElementLink< DOBJ > ElemLink
ElemLink::sgkey_t sgkey_t
IndexingPolicy::ElementConstPointer ElementConstPointer
ElemLink::ElementConstPointer ElementConstPointer
const_reference operator[](size_type n) const
ElementLinkVector implementation for standalone ROOT.
bool operator==(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
std::vector< size_t > vec
iterator erase(iterator position)
ELVIterator operator--(int)
size_type max_size() const
bool toPersistent(std::vector< typename DataLinkVector::size_type > &shortrefs)
void swap(ElemLinkVec &vec)
Base class holding the container independent part of ElementLinkVector.
ElementLinkVector< DOBJ > ElemLinkVec
std::vector< DataLink< DOBJ > > DataLinkVector
DataLinkVector::iterator beginHostDObjs()
iterator erase(iterator first, iterator last)
const_reference at(size_type n) const
const ElemLink * const_pointer
ElementLinkVector & operator=(const ElemLinkVec &vec)
void reserve(size_type n)
bool operator<(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
RefVector::allocator_type allocator_type
DataLinkVector::iterator findHostDObj(const ElemLink &link)
find the host of an element. Returns endHostDObjs() if not found
ElementLinkVector< DOBJ > ElemLinkVec
ROOT::Meta::Selection::ElementLinkVector< DOBJ >::self DictSel
Needed for the simplified Reflex class name.
a short ref to an ElementLink into an ElementLinkVector. Used to be an internal class of ElementLinkV...
void toTransient(INDEX_TYPE &dummy)
Function taking care of all the other indexing types (no direct ROOT I/O)
void removeHostObj(const ElemLink &)
remove host of link from list. O(N) in m_hostDObjs (which is small)
DataLinkVector::iterator endHostDObjs()
void toTransient(uint32_t &dummy)
bool operator!=(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
RefVector::size_type size_type
const ElemLink operator()(const ElemLinkRef &shortRef) const
class iterator - iterator over elements in DataLinkVector which manages the Entry objects
bool toTransient()
Reset the object's internal cache.
void addHostDObj(const ElemLink &link)
add host of link to list. No duplicates. O(N) in m_hostDObjs
DataLinkVector m_hostDObjs
the dobjs hosting our elements. They are all of type DOBJ
ElementLinkVectorBase(const std::vector< uint32_t > &keys=std::vector< uint32_t >(), const std::vector< uint32_t > &indices=std::vector< uint32_t >())
Default constructor.
const DataLinkVector & hostDObjs() const
ElementLinkVector(int n, const ElemLink &link=ElemLink())
bool operator>(const ElementLinkVector< DOBJ > &lhs, const ElementLinkVector< DOBJ > &rhs)
RefVector::difference_type difference_type
RefVector::const_iterator shortIterFromLong(const_iterator longIter) const
get a short ref iterator from an iterator
ElementLinkVector(size_type n)
ElementConstPointer elementCPtr(size_type index) const
pointer to an element, given its ElementLinkVector index. O(1)
void assign(size_type n, const ElemLink &link)
void push_back(const ElemLink &link)
ElemLink::index_type index_type
ID_type elementDataID(size_type index) const
dataID (long ref) of an element, given its ElementLinkVector index. O(1)
a functor turning an ElemLinkRef into an ElementLink
const_reference front() const
void insert(iterator position, InputIterator first, InputIterator last)
std::vector< uint32_t > m_persKeys
Keys/identifiers of the referenced containers.
const_iterator begin() const
const_reverse_iterator rbegin() const
const_reference back() const
void push_back(typename DataLinkVector::size_type nameIndex, typename ElemLinkRef::index_type elementIndex)
RefVector::iterator shortIterFromLong(iterator longIter)
get a short ref iterator from an iterator
DataLinkVector::const_iterator findHostDObj(const ElemLink &link) const
find the host of an element. Returns endHostDObjs() if not found
ElementLinkVector(ElemLinkVec &&vec) noexcept
index_type elementIndex(size_type index) const
host index of an element, given its ElementLinkVector index. O(1)
const_reverse_iterator rend() const
void resize(size_type sz, const ElemLink &link=ElemLink())
std::vector< ElemLinkRef > RefVector
the element links stored as ElemLinkRefs for compactness
ElementLinkVector(InputIterator first, InputIterator last)
void insert(iterator position, size_type n, const ElemLink &link)
iterator insert(iterator position, const ElemLink &link)
IndexingPolicy::index_type index_type
The index type presented to and returned from the link.
SG::ELVRef< DOBJ > ElemLinkRef
ElemLink operator()(ElemLinkRef &shortRef) const
ElementLinkVector(long n, const ElemLink &link=ElemLink())
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
ELVIterator< typename RefVector::const_reverse_iterator > const_reverse_iterator
Selection rules: declare transient members.
ElemLink::ID_type ID_type
ElemLink::index_type index_type
const ElemLink & elementLink() const
get the corresponding ElementLink. O(1)
const_iterator end() const
void toTransient(uint64_t &dummy)
Function setting up the object for forward indexing types.