Honeycomb  0.1
Component-Model Framework
Classes | Namespaces | Macros | Functions
Range.h File Reference
#include "Honey/Math/Numeral.h"
Include dependency graph for Range.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  honey::mt::isRange< T >
 Check if type is a range or a reference to one. A range is a type where std::begin(range) is a valid call. More...
 
struct  honey::mt::iterOf< Range >
 Get range iterator begin type. More...
 
struct  honey::mt::iter_endOf< Range >
 Get range iterator end type. More...
 
struct  honey::mt::elemOf< Range >
 Get range element type. More...
 
class  honey::Range_< T1_, T2_ >
 Iterator range. See range(Iter1&&, Iter2&&) to create. More...
 
class  honey::IntIter< T >
 Incremental integer iterator (step size = 1). See range(int, int) to create. More...
 
class  honey::IntStepIter< T >
 Integer iterator with step size. See range(int, int, int) to create. More...
 
class  honey::RealIter< T >
 Real number iterator. See range(Real, Real, Real) to create. More...
 
class  honey::TupleIter< Iter, I, IterCategory >
 Wrapper around an iterator with tuple value type. When dereferenced returns I'th element. More...
 
class  honey::TupleIter< Iter, I, std::forward_iterator_tag >
 
class  honey::TupleIter< Iter, I, std::bidirectional_iterator_tag >
 
class  honey::RingIter< Range, Iter >
 Ring iterator. See ringRange() to create. More...
 

Namespaces

 honey
 Global Honeycomb namespace.
 
 honey::mt
 Meta-programming and compile-time util.
 

Macros

#define RANGE_ARG_MAX   3
 Max args for range related variable argument functions. More...
 
#define mt_iterOf(Range)    typename std::decay<decltype(honey::begin(Range))>::type
 iterOf for values More...
 
#define mt_iter_endOf(Range)    typename std::decay<decltype(honey::end(Range))>::type
 iter_endOf for values More...
 
#define mt_elemOf(Range)    typename mt::removeRef<decltype(*honey::begin(Range))>::type
 elemOf for values More...
 

Functions

template<class Result = void, class... Ts>
std::conditional< std::is_same< Result, void >::value, mt::typeAt< 0, Ts... >, Result >::type honey::mt::valAt (int i, Ts &&...ts)
 Get value at index of parameter pack. All types must be convertible to Result, which defaults to the first type in Ts. More...
 
template<class Val , class... Ts>
int honey::mt::valIndex (Val &&val, Ts &&...ts)
 Get index of first matching value in parameter pack, returns -1 if not found. More...
 
template<class Iter >
auto honey::seqToIter (Iter &&seq) -> typename std::enable_if< mt::isIterator< Iter >::value, Iter && >::type
 Convert a sequence to a forward iterator. Overload for iterator type. Returns the iterator itself. More...
 
template<class Range >
auto honey::seqToIter (Range &&seq) -> typename std::enable_if< mt::isRange< Range >::value, mt_iterOf(seq)>::type
 Convert a sequence to a forward iterator. Overload for range type. Returns the range's begin iterator. More...
 
template<class Iter1 , class Iter2 >
std::enable_if< mt::isIterator< Iter1 >::value, Range_< Iter1, Iter2 > >::type honey::range (Iter1 &&first, Iter2 &&last)
 Range from iterators [first, last) More...
 
template<class T1 , class T2 >
Range_< T1, T2 > honey::range (pair< T1, T2 > &p)
 Range from iterator pair [first, second) More...
 
template<class T1 , class T2 >
Range_< T1, T2 > honey::range (const pair< T1, T2 > &p)
 
template<class T1 , class T2 >
Range_< T1, T2 > honey::range (tuple< T1, T2 > &t)
 Range from iterator tuple [0, 1) More...
 
template<class T1 , class T2 >
Range_< T1, T2 > honey::range (const tuple< T1, T2 > &t)
 
template<class Range >
auto honey::reversed (Range &&range) -> Range_< std::reverse_iterator< mt_iterOf(range)>, std::reverse_iterator< mt_iter_endOf(range)>>
 Reverse a range. Begin/End iterators must be bidirectional. More...
 
OutSeq && honey::map (Range &&, Seqs &&..., OutSeq &&, Func &&)
 Transform a series of sequences into an output. More...
 
Accum honey::reduce (Range &&, Seqs &&..., Accum &&initVal, Func &&)
 Accumulate a series of sequences into an output. More...
 
Iter honey::find (Range &&, Seqs &&..., Func &&pred)
 Find an element in a series of sequences. More...
 
Range_< FilterIter, FilterIter > honey::filter (Range &&, Seqs &&..., Func &&pred)
 Filter a range by ignoring undesired elements. More...
 
template<class Range >
szt honey::countOf (Range &&range)
 Count number of elements in range. More...
 
template<class Range >
void honey::deleteRange (Range &&range)
 Delete all elements in range. More...
 
template<class Range , class Alloc >
void honey::deleteRange (Range &&range, Alloc &&a)
 Delete all elements in range using allocator. More...
 
template<class Int , class Int2 , class Int_ = typename std::common_type<Int,Int2>::type>
std::enable_if< std::is_integral< Int_ >::value, Range_< IntIter< Int_ >, IntIter< Int_ > > >::type honey::range (Int begin, Int2 end)
 Create a range that increments through the integral range [begin,end) More...
 
template<class Int >
std::enable_if< std::is_integral< Int >::value, Range_< IntIter< Int >, IntIter< Int > > >::type honey::range (Int end)
 Create a range that increments through the integral range [0,end) More...
 
template<class Int , class Int2 , class Int3 , class Int_ = typename std::common_type<Int,Int2,Int3>::type>
std::enable_if< std::is_integral< Int_ >::value, Range_< IntStepIter< Int_ >, IntStepIter< Int_ > > >::type honey::range (Int begin, Int2 end, Int3 step)
 Create a range that steps through the integral range [begin,end) More...
 
template<class Real , class Real2 , class Real3 , class Real_ = typename std::common_type<Real,Real2,Real3>::type>
std::enable_if< std::is_floating_point< Real_ >::value, Range_< RealIter< Real_ >, RealIter< Real_ > > >::type honey::range (Real begin, Real2 end, Real3 step=1)
 Create a range that steps through the real number range [begin,end) More...
 
template<class Range , class Iter >
auto honey::ringRange (Range &&range, const Iter &cur) -> Range_< RingIter< Range, Iter >, RingIter< Range, Iter >>
 Create an iterator adapter range that does one full cyclic loop starting at cur through the range. More...
 

Macro Definition Documentation

#define mt_elemOf (   Range)    typename mt::removeRef<decltype(*honey::begin(Range))>::type

elemOf for values

#define mt_iter_endOf (   Range)    typename std::decay<decltype(honey::end(Range))>::type

iter_endOf for values

#define mt_iterOf (   Range)    typename std::decay<decltype(honey::begin(Range))>::type

iterOf for values