proxygen
folly::gen::detail::Stride Class Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::Stride:
folly::gen::Operator< Stride > folly::gen::FBounded< Self >

Classes

class  Generator
 

Public Member Functions

 Stride (size_t stride)
 
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen compose (GenImpl< Value, Source > &&source) const
 
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Stride >
ResultGen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Private Attributes

size_t stride_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::gen::Operator< Stride >
 Operator ()=default
 
 Operator (Operator &&) noexcept=default
 
 Operator (const Operator &)=default
 
Operatoroperator= (Operator &&) noexcept=default
 
Operatoroperator= (const Operator &)=default
 

Detailed Description

Stride - For producing every Nth value from a source.

This type is usually used through the 'stride' helper function, like:

auto half = from(samples) | stride(2);

Definition at line 807 of file Base-inl.h.

Constructor & Destructor Documentation

folly::gen::detail::Stride::Stride ( size_t  stride)
inlineexplicit

Definition at line 811 of file Base-inl.h.

811  : stride_(stride) {
812  if (stride == 0) {
813  throw std::invalid_argument("stride must not be 0");
814  }
815  }
detail::Stride stride(size_t s)
Definition: Base-inl.h:2589

Member Function Documentation

template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Stride::compose ( GenImpl< Value, Source > &&  source) const
inline

Definition at line 856 of file Base-inl.h.

References folly::gen::move.

856  {
857  return Gen(std::move(source.self()), stride_);
858  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Stride::compose ( const GenImpl< Value, Source > &  source) const
inline

Definition at line 861 of file Base-inl.h.

References folly::gen::FBounded< Self >::self().

861  {
862  return Gen(source.self(), stride_);
863  }

Member Data Documentation

size_t folly::gen::detail::Stride::stride_
private

Definition at line 808 of file Base-inl.h.


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