CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Iterator.hpp File Reference
#include "CeresEngine/DataTypes.hpp"
#include "CeresEngine/Macros.hpp"
#include "CeresEngine/Foundation/Container/Pair.hpp"
#include <algorithm>
#include <exception>
#include <functional>
#include <iterator>
#include <tuple>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

struct  CeresEngine::IterationEnd
 The end state for self-contained iterators. More...
 
struct  CeresEngine::impl::compare::ByValue
 
struct  CeresEngine::impl::compare::ByValueGTE
 
struct  CeresEngine::impl::compare::ByAddress
 
struct  CeresEngine::impl::compare::ByLastTupleElementMatch
 
struct  CeresEngine::impl::compare::Never
 
struct  CeresEngine::impl::increment::ByValue< A >
 
struct  CeresEngine::impl::increment::ByPrefixIncrement
 
struct  CeresEngine::impl::increment::ByPostfixIncrement
 
struct  CeresEngine::impl::increment::ByCallback< Callback >
 
struct  CeresEngine::impl::increment::ByTupleIncrement
 
struct  CeresEngine::impl::increment::ByMemberCall< T, M, Method >
 
struct  CeresEngine::impl::dereference::ByValue
 
struct  CeresEngine::impl::dereference::ByConstValueReference
 
struct  CeresEngine::impl::dereference::ByValueReference
 
struct  CeresEngine::impl::dereference::ByValueDereference
 
struct  CeresEngine::impl::dereference::ByPointerReference
 Dereferencing helper used to dereference a pointer type from a pointer iterator. More...
 
struct  CeresEngine::impl::dereference::ByCallback< Callback >
 
struct  CeresEngine::impl::dereference::ByTupleDereference
 
struct  CeresEngine::impl::dereference::ByMemberCall< T, M, Method >
 
struct  CeresEngine::impl::dereference::ByMemberVariable< M, Member >
 
struct  CeresEngine::UndefinedIteratorException
 Exception when dereferencing an undefined iterator value. More...
 
class  CeresEngine::IteratorPrototype< T, D, C >
 Base class for simple iterators. More...
 
struct  CeresEngine::impl::WithState
 
struct  CeresEngine::impl::WithoutState
 
class  CeresEngine::Iterator< T, F, D, C >
 IteratorPrototype where advance is defined by the functional held by F. More...
 
struct  CeresEngine::WrappedIterator< IB, IE, Context >
 Helper class for wrap(). More...
 
struct  CeresEngine::WrappedIterator< IB, IE >
 Helper class for wrap(). More...
 
struct  CeresEngine::RangeIterator< T >
 Helper class for range(). More...
 
struct  CeresEngine::InitializedIterable
 When used as a base class for a iterator type, MakeIterable will call the bool init() member before iteration. More...
 
struct  CeresEngine::MakeIterable< T >
 Take a class T with that defines the methods T::advance() and O T::value() for any type O and wraps it into a single-use iterable class. More...
 

Namespaces

namespace  CeresEngine
 
namespace  CeresEngine::impl
 Helper functions for comparing iterators.
 
namespace  CeresEngine::impl::compare
 
namespace  CeresEngine::impl::increment
 Helper functions for incrementing iterators.
 
namespace  CeresEngine::impl::dereference
 Helper functions for dereferencing iterators.
 

Typedefs

template<class T , class A = impl::increment::ByValue<1>>
using CeresEngine::ReferenceIterator = Iterator< T *, A, impl::dereference::ByValueDereference >
 Iterates by incrementing a pointer value. Returns the dereferenced pointer.
 

Functions

template<class T >
 CeresEngine::IteratorPrototype (const T &) -> IteratorPrototype< T >
 
template<class T , typename D >
 CeresEngine::IteratorPrototype (const T &, const D &) -> IteratorPrototype< T, D >
 
template<class T , typename D , typename C >
 CeresEngine::IteratorPrototype (const T &, const D &, const C &) -> IteratorPrototype< T, D, C >
 
template<class T >
 CeresEngine::Iterator (const T &) -> Iterator< T >
 
template<class T , typename F >
 CeresEngine::Iterator (const T &, const F &) -> Iterator< T, F >
 
template<class T , typename F , typename D >
 CeresEngine::Iterator (const T &, const F &, const D &) -> Iterator< T, F, D >
 
template<class T , typename F , typename D , typename C >
 CeresEngine::Iterator (const T &, const F &, const D &, const C &) -> Iterator< T, F, D, C >
 
template<class T , typename F = impl::increment::ByValue<1>, typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
Iterator< T, F, D, CCeresEngine::makeIterator (T &&t, F f=F(), D &&d=D(), C &&c=C())
 
template<class IB , class IE , class Context >
auto CeresEngine::wrap (IB &&a, IE &&b, Context &&context)
 Wraps two iterators into a single-use container with begin/end methods to match the C++ iterator convention.
 
template<class IB , class IE , class Context >
auto CeresEngine::wrap (Pair< IB, IE > &&pair, Context &&context)
 Wraps two iterators into a single-use container with begin/end methods to match the C++ iterator convention.
 
template<class IB , class IE >
auto CeresEngine::wrap (IB &&a, IE &&b)
 Wraps two iterators into a single-use container with begin/end methods to match the C++ iterator convention.
 
template<class IB , class IE >
auto CeresEngine::wrap (Pair< IB, IE > &&pair)
 Wraps two iterators into a single-use container with begin/end methods to match the C++ iterator convention.
 
template<class T >
RangeIterator< TCeresEngine::rangeValue (T v, T i=1)
 
template<class T >
auto CeresEngine::range (T begin, T end, T increment)
 Returns an iterator that increases it's value from begin to the first value <= end by increment for each step.
 
template<class T >
auto CeresEngine::range (T begin, T end)
 Returns an iterator that increases it's value from begin to end by 1 for each step.
 
template<class T >
auto CeresEngine::range (T end)
 Returns an iterator that increases it's value from 0 to end by 1 for each step.
 
template<class T = UInt64>
auto CeresEngine::range ()
 Returns an iterator that increases it's value from 0 to end by 1 for each step.
 
template<typename T = UInt64, typename Container >
auto CeresEngine::indices (const Container &container)
 Returns an iterator that increases it's value from 0 to container.size() by 1 on each step.
 
template<typename Container >
auto CeresEngine::indices (const Container &container)
 Returns an iterator that increases it's value from 0 to container.size() by 1 on each step.
 
template<class T >
auto CeresEngine::reverse (T &v)
 Wraps the rbegin and rend iterators.
 
template<typename... Args>
auto CeresEngine::zip (Args &&... args)
 Returns an iterable object where all argument iterators are traversed simultaneously.
 
template<typename Container >
auto CeresEngine::keys (Container &container)
 Returns an iterable object that iterates over the keys of a map-like container.
 
template<typename Container >
auto CeresEngine::keys (Container &&container)
 Returns an iterable object that iterates over the keys of a map-like container.
 
template<typename Container >
auto CeresEngine::values (Container &container)
 Returns an iterable object that iterates over the values of a map-like container.
 
template<typename Container >
auto CeresEngine::values (Container &&container)
 Returns an iterable object that iterates over the values of a map-like container.
 
template<typename Container >
auto CeresEngine::dereference (Container &container)
 Returns an iterable object that iterates over the values of Container but also dereferences the pointers.
 
template<typename Container >
auto CeresEngine::dereference (Container &&container)
 Returns an iterable object that iterates over the values of Container but also dereferences the pointers.
 
template<typename Container , typename Transform >
auto CeresEngine::transform (Container &container, Transform &&transform)
 Returns an iterable object that iterates over the values of the container and applies transform to every value in it.
 
template<typename Container , typename Transform >
auto CeresEngine::transform (Container &&container, Transform &&transform)
 Returns an iterable object that iterates over the values of the container and applies transform to every value in it.
 
template<typename Container , typename Predicate >
auto CeresEngine::filter (Container &container, Predicate &&predicate)
 Returns an iterable object that iterates over the values of the container and applies transform to every value in it.
 
template<typename Container , typename Predicate >
auto CeresEngine::filter (Container &&container, Predicate &&predicate)
 
template<typename Container >
auto CeresEngine::unique (Container &container)
 Returns an iterable object that iterates over all unique values on the container.
 
template<typename Container >
auto CeresEngine::unique (Container &&container)
 Returns an iterable object that iterates over all unique values on the container.
 
template<typename Container >
auto CeresEngine::skipNull (Container &container)
 Returns an iterable object that iterates over the non-null values of container.
 
template<typename Container >
auto CeresEngine::skipNull (Container &&container)
 Returns an iterable object that iterates over the non-null values of container.
 
template<typename Container >
auto CeresEngine::weakLock (Container &container)
 Returns an iterable object that iterates over the locked weak pointers of Container.
 
template<typename Container >
auto CeresEngine::weakLock (Container &&container)
 Returns an iterable object that iterates over the locked weak pointers of Container.
 
template<class T , class I = impl::increment::ByValue<1>>
auto CeresEngine::valuesBetween (T *begin, T *end)
 Iterates over the dereferenced values between begin and end.
 
template<class T , class A >
void CeresEngine::fill (A &arr, const T &value)
 Copy-assigns the given value to every element in a container.
 
template<class A , class B , class T = impl::dereference::ByValueReference>
void CeresEngine::copy (const A &a, B &b, T &&t=T())
 Copies values from one container to another.
 
template<class I , class C >
bool CeresEngine::eraseIfFound (const I &it, C &container)
 Removes a value from a container with find method.
 

Variables

template<class I , class C >
decltype(&*std::declval< I >() CeresEngine::found )(const I &it, C &container)
 Returns a pointer to the value if found, otherwise nullptr.