Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE > Class Template Reference

#include <DisjointDiscreteRange.h>

Inheritance diagram for Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >:
Stroika::Foundation::Traversal::DisjointRange< T, RANGE_TYPE >

Classes

struct  FindHints
 

Public Member Functions

 DisjointDiscreteRange ()=default
 
nonvirtual Iterable< value_type > Elements () const
 
nonvirtual optional< value_type > Find (const function< bool(value_type)> &that) const
 
nonvirtual optional< value_type > FindLastThat (const function< bool(value_type)> &testF) const
 
- Public Member Functions inherited from Stroika::Foundation::Traversal::DisjointRange< T, RANGE_TYPE >
 DisjointRange ()=default
 
nonvirtual Containers::Sequence< RangeTypeSubRanges () const
 
nonvirtual bool empty () const
 
nonvirtual void clear ()
 
nonvirtual bool Contains (value_type elt) const
 
nonvirtual RangeType GetBounds () const
 
nonvirtual RangeType Closure () const
 like GetBounds (), but always returns a closed range
 
constexpr bool operator== (const DisjointRange &rhs) const
 

Additional Inherited Members

- Public Types inherited from Stroika::Foundation::Traversal::DisjointRange< T, RANGE_TYPE >
using RangeType = RANGE_TYPE
 a Disjoint range collection of (disjoint) ranges of this type.
 
using value_type = typename RangeType::value_type
 Range::value_type is the type of the contained elements of the range (say range of integers, value_type=int)
 

Detailed Description

template<typename T, typename RANGE_TYPE = DiscreteRange<T>>
class Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >

Definition at line 31 of file DisjointDiscreteRange.h.

Constructor & Destructor Documentation

◆ DisjointDiscreteRange()

template<typename T , typename RANGE_TYPE = DiscreteRange<T>>
Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >::DisjointDiscreteRange ( )
default

You can pass in empty Ranges, and ranges out of order, but the constructor always filters out empty ranges, and re-orders so subranges well-ordered.

Member Function Documentation

◆ Elements()

template<typename T , typename RANGE_TYPE >
auto Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >::Elements ( ) const
Example Usage

Elements () makes no guarantees about whether or not modifications to the underlying DisjointDiscreteRange<> will appear in the Elements() Iterable<T>.

Definition at line 171 of file DisjointDiscreteRange.inl.

◆ Find()

template<typename T , typename RANGE_TYPE >
auto Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >::Find ( const function< bool(value_type)> &  that) const

Find the first element of the DisjointDiscreteRange that passes the argument function test. &&&& docs - assumes a bit that one subrange meeting criteria - fill in details

Definition at line 207 of file DisjointDiscreteRange.inl.

◆ FindLastThat()

template<typename T , typename RANGE_TYPE >
auto Stroika::Foundation::Traversal::DisjointDiscreteRange< T, RANGE_TYPE >::FindLastThat ( const function< bool(value_type)> &  testF) const

Find the last element of the DisjointDiscreteRange that passes the argument function test. &&&& docs - assumes a bit that one subrange meeting criteria - fill in details

Definition at line 237 of file DisjointDiscreteRange.inl.


The documentation for this class was generated from the following files: