OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Step< T, N, S > Class Template Reference

#include <Step.hpp>

Public Types

using value_type = T
 
using iterator = Iterator
 

Public Member Functions

constexpr SIV3D_NODISCARD_CXX20 Step (T startValue, N count, S step)
 
constexpr iterator begin () const
 
constexpr iterator end () const
 
constexpr value_type startValue () const
 
constexpr N count () const
 
constexpr S step () const
 
constexpr bool isEmpty () const
 
 operator Array< value_type > () const
 
Array< value_typeasArray () const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
constexpr auto operator>> (Fty f) const
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr N count_if (Fty f) const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
void each (Fty f) const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, T >> * = nullptr>
void each_index (Fty f) const
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr auto filter (Fty f) const
 
constexpr bool include (const value_type &x) const
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr bool include_if (Fty f) const
 
String join (StringView sep=U", ", StringView begin=U"{", StringView end=U"}") const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
constexpr auto map (Fty f) const
 
template<class Fty , class R = std::decay_t<std::invoke_result_t<Fty, T, T>>>
constexpr auto reduce (Fty f, R init) const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T, T >> * = nullptr>
constexpr auto reduce1 (Fty f) const
 
constexpr auto sum () const
 
Array< value_typetake (size_t n) const
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
Array< value_typetake_while (Fty f) const
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
parallel_count_if (Fty f, size_t numThreads=Threading::GetConcurrency()) const
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
void parallel_each (Fty f, size_t numThreads=Threading::GetConcurrency()) const
 

Friends

template<class CharType >
std::basic_ostream< CharType > & operator<< (std::basic_ostream< CharType > &output, const Step &value)
 
void Formatter (FormatData &formatData, const Step &value)
 

Member Typedef Documentation

◆ iterator

template<class T , class N , class S >
using s3d::Step< T, N, S >::iterator = Iterator

◆ value_type

template<class T , class N , class S >
using s3d::Step< T, N, S >::value_type = T

Constructor & Destructor Documentation

◆ Step()

template<class T , class N , class S >
constexpr SIV3D_NODISCARD_CXX20 s3d::Step< T, N, S >::Step ( startValue,
count,
step 
)
constexpr

Member Function Documentation

◆ asArray()

template<class T , class N , class S >
Array<value_type> s3d::Step< T, N, S >::asArray ( ) const

◆ begin()

template<class T , class N , class S >
constexpr iterator s3d::Step< T, N, S >::begin ( ) const
constexpr

◆ count()

template<class T , class N , class S >
constexpr N s3d::Step< T, N, S >::count ( ) const
constexpr

◆ count_if()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr N s3d::Step< T, N, S >::count_if ( Fty  f) const
constexpr

◆ each()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
void s3d::Step< T, N, S >::each ( Fty  f) const

◆ each_index()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, T >> * = nullptr>
void s3d::Step< T, N, S >::each_index ( Fty  f) const

◆ end()

template<class T , class N , class S >
constexpr iterator s3d::Step< T, N, S >::end ( ) const
constexpr

◆ filter()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr auto s3d::Step< T, N, S >::filter ( Fty  f) const
constexpr

◆ include()

template<class T , class N , class S >
constexpr bool s3d::Step< T, N, S >::include ( const value_type x) const
constexpr

◆ include_if()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
constexpr bool s3d::Step< T, N, S >::include_if ( Fty  f) const
constexpr

◆ isEmpty()

template<class T , class N , class S >
constexpr bool s3d::Step< T, N, S >::isEmpty ( ) const
constexpr

◆ join()

template<class T , class N , class S >
String s3d::Step< T, N, S >::join ( StringView  sep = U", ",
StringView  begin = U"{",
StringView  end = U"}" 
) const

◆ map()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
constexpr auto s3d::Step< T, N, S >::map ( Fty  f) const
constexpr

◆ operator Array< value_type >()

template<class T , class N , class S >
s3d::Step< T, N, S >::operator Array< value_type > ( ) const

◆ operator>>()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
constexpr auto s3d::Step< T, N, S >::operator>> ( Fty  f) const
constexpr

◆ parallel_count_if()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
N s3d::Step< T, N, S >::parallel_count_if ( Fty  f,
size_t  numThreads = Threading::GetConcurrency() 
) const

◆ parallel_each()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T >> * = nullptr>
void s3d::Step< T, N, S >::parallel_each ( Fty  f,
size_t  numThreads = Threading::GetConcurrency() 
) const

◆ reduce()

template<class T , class N , class S >
template<class Fty , class R = std::decay_t<std::invoke_result_t<Fty, T, T>>>
constexpr auto s3d::Step< T, N, S >::reduce ( Fty  f,
init 
) const
constexpr

◆ reduce1()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, T, T >> * = nullptr>
constexpr auto s3d::Step< T, N, S >::reduce1 ( Fty  f) const
constexpr

◆ startValue()

template<class T , class N , class S >
constexpr value_type s3d::Step< T, N, S >::startValue ( ) const
constexpr

◆ step()

template<class T , class N , class S >
constexpr S s3d::Step< T, N, S >::step ( ) const
constexpr

◆ sum()

template<class T , class N , class S >
constexpr auto s3d::Step< T, N, S >::sum ( ) const
constexpr

◆ take()

template<class T , class N , class S >
Array<value_type> s3d::Step< T, N, S >::take ( size_t  n) const

◆ take_while()

template<class T , class N , class S >
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, T >> * = nullptr>
Array<value_type> s3d::Step< T, N, S >::take_while ( Fty  f) const

Friends And Related Function Documentation

◆ Formatter

template<class T , class N , class S >
void Formatter ( FormatData formatData,
const Step< T, N, S > &  value 
)
friend
Parameters
formatData
value

◆ operator<<

template<class T , class N , class S >
template<class CharType >
std::basic_ostream<CharType>& operator<< ( std::basic_ostream< CharType > &  output,
const Step< T, N, S > &  value 
)
friend
Template Parameters
CharType
Parameters
output
value
Returns


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