proxygen
folly::gen::detail::Window Class Reference

#include <Base-inl.h>

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

Classes

class  Generator
 

Public Member Functions

 Window (size_t windowSize)
 
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< Window >
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 windowSize_
 

Additional Inherited Members

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

Detailed Description

Window - For overlapping the lifetimes of pipeline values, especially with Futures.

This type is usually used through the 'window' helper function:

auto responses = byLine(STDIN) | map(makeRequestFuture) | window(1000) | map(waitFuture) | as<vector>();

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

Constructor & Destructor Documentation

folly::gen::detail::Window::Window ( size_t  windowSize)
inlineexplicit

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

References type, and testing::Value().

1522  : windowSize_(windowSize) {
1523  if (windowSize_ == 0) {
1524  throw std::invalid_argument("Window size must be non-zero!");
1525  }
1526  }

Member Function Documentation

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

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

References folly::gen::move.

1592  {
1593  return Gen(std::move(source.self()), windowSize_);
1594  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Window::compose ( const GenImpl< Value, Source > &  source) const
inline

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

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

1597  {
1598  return Gen(source.self(), windowSize_);
1599  }

Member Data Documentation

size_t folly::gen::detail::Window::windowSize_
private

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


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