LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Builds and keeps track of internal boundaries in a sequence. More...
#include "AssociatedData.h"
Public Types | |
using | data_iterator_t = Iter |
using | boundaries_t = std::vector< data_iterator_t > |
using | range_iterator_t = BoundaryListRangeIterator< typename boundaries_t::const_iterator > |
Iterator on the ranges contained in the collection. More... | |
using | range_ref_t = typename range_iterator_t::value_type |
Structure holding begin and end iterator for a single range. More... | |
using | range_t = lar::RangeAsCollection_t< data_iterator_t > |
Range object directly containing the boundary iterators. More... | |
Public Member Functions | |
BoundaryList (boundaries_t &&boundaries) | |
Constructor: steals the specified boundary list. More... | |
std::size_t | nRanges () const |
Returns the number of ranges contained in the list. More... | |
data_iterator_t const & | rangeBegin (std::size_t i) const |
Returns the begin iterator of the i -th range (end if overflow). More... | |
data_iterator_t const & | rangeEnd (std::size_t i) const |
Returns the end iterator of the i -th range (end if overflow). More... | |
std::size_t | size () const |
Returns the number of ranges contained in the list. More... | |
range_iterator_t | begin () const |
Returns the begin iterator of the first range. More... | |
range_iterator_t | end () const |
Returns the end iterator of the last range. More... | |
range_ref_t | rangeRef (std::size_t i) const |
Returns the specified range. More... | |
range_t | range (std::size_t i) const |
Returns the specified range in an object holding the iterators. More... | |
auto | operator[] (std::size_t i) const -> decltype(auto) |
Private Types | |
using | boundarylist_t = BoundaryList< Iter > |
Private Attributes | |
boundaries_t | boundaries |
Begin iterator of each range, plus end iterator of whole sequence. More... | |
Builds and keeps track of internal boundaries in a sequence.
Iter | type of iterators to the original sequence |
This class manages a sequence of boundary iterators defining the beginning of contiguous subsequences. Each iterator marks the begin of a subsequence, whose end is marked by the beginning of the next one. The last iterator in the boundary list marks the end of the last subsequence, but it does not mark the beginning of a following one. Therefore, for a list of N subsequences there will be N + 1 boundary iterators in the list: N marking the beginning of the respective subsequences, plus another marking the end of the last subsequence.
It is likely that the first iterator in the boundary list is the begin iterator of the underlying sequence (usually a container) being partitioned, while the last one is the end iterator of that sequence.
This is a data class which does not contain any logic to define the subsequences, but rather acquires the result of an algorithm which is expected to have established which the boundaries are.
The underlying representation of the class is a random-access sequence of boundaries. The exposed value, range_t
, is a range of data elements (a view with the interface of a random access container), which is internally represented as a single iterator pointing to the begin iterator of the range.
Definition at line 669 of file AssociatedData.h.
using proxy::details::BoundaryList< Iter >::boundaries_t = std::vector<data_iterator_t> |
Definition at line 673 of file AssociatedData.h.
|
private |
Definition at line 670 of file AssociatedData.h.
using proxy::details::BoundaryList< Iter >::data_iterator_t = Iter |
Definition at line 672 of file AssociatedData.h.
using proxy::details::BoundaryList< Iter >::range_iterator_t = BoundaryListRangeIterator<typename boundaries_t::const_iterator> |
Iterator on the ranges contained in the collection.
Definition at line 677 of file AssociatedData.h.
using proxy::details::BoundaryList< Iter >::range_ref_t = typename range_iterator_t::value_type |
Structure holding begin and end iterator for a single range.
Definition at line 681 of file AssociatedData.h.
using proxy::details::BoundaryList< Iter >::range_t = lar::RangeAsCollection_t<data_iterator_t> |
Range object directly containing the boundary iterators.
Definition at line 684 of file AssociatedData.h.
|
inlineexplicit |
Constructor: steals the specified boundary list.
Definition at line 688 of file AssociatedData.h.
|
inline |
Returns the begin iterator of the first range.
Definition at line 705 of file AssociatedData.h.
|
inline |
Returns the end iterator of the last range.
Definition at line 708 of file AssociatedData.h.
Referenced by proxy::details::associationRangesImpl().
|
inline |
Returns the number of ranges contained in the list.
Definition at line 693 of file AssociatedData.h.
|
inline |
Returns the begin iterator of the i
-th range (unchecked).
range()
Definition at line 744 of file AssociatedData.h.
|
inline |
Returns the specified range in an object holding the iterators.
i | index of the range to be returned |
rangeRef()
The returned object contains copies of the begin and end iterators of the range. This object is self-contained and valid even after this BoundaryList object is destroyed.
Note the content of the range itself is not copied: just the boundary iterators of the range are.
Definition at line 739 of file AssociatedData.h.
|
inline |
Returns the begin iterator of the i
-th range (end if overflow).
Definition at line 696 of file AssociatedData.h.
|
inline |
Returns the end iterator of the i
-th range (end if overflow).
Definition at line 699 of file AssociatedData.h.
|
inline |
Returns the specified range.
i | index of the range to be returned |
range()
The returned object exposes the range as a random access container interface.
Internally, it refers to the relevant information from this BoundaryList
object, and therefore it becomes invalid when this BoundaryList
object is destroyed. If this is not acceptable, use range()
instead.
Definition at line 724 of file AssociatedData.h.
|
inline |
Returns the number of ranges contained in the list.
Definition at line 703 of file AssociatedData.h.
|
private |
Begin iterator of each range, plus end iterator of whole sequence.
Definition at line 749 of file AssociatedData.h.