proxygen
folly::gen::detail::Chain< Value, First, Second > Class Template Reference

#include <Core-inl.h>

Inheritance diagram for folly::gen::detail::Chain< Value, First, Second >:
folly::gen::GenImpl< Value, Chain< Value, First, Second > > folly::gen::FBounded< Self >

Public Member Functions

 Chain (First first, Second second)
 
template<class Handler >
bool apply (Handler &&handler) const
 
template<class Body >
void foreach (Body &&body) const
 
- Public Member Functions inherited from folly::gen::GenImpl< Value, Chain< Value, First, Second > >
bool apply (Handler &&handler) const
 
void foreach (Body &&body) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Static Public Attributes

static constexpr bool infinite = First::infinite || Second::infinite
 
- Static Public Attributes inherited from folly::gen::GenImpl< Value, Chain< Value, First, Second > >
static constexpr bool infinite
 

Private Attributes

First first_
 
Second second_
 

Additional Inherited Members

- Public Types inherited from folly::gen::GenImpl< Value, Chain< Value, First, Second > >
typedef Value ValueType
 
typedef std::decay< Value >::type StorageType
 
- Protected Member Functions inherited from folly::gen::GenImpl< Value, Chain< Value, First, Second > >
 GenImpl ()=default
 
 GenImpl (GenImpl &&)=default
 
 GenImpl (const GenImpl &)=default
 
GenImploperator= (GenImpl &&)=default
 
GenImploperator= (const GenImpl &)=default
 

Detailed Description

template<class Value, class First, class Second>
class folly::gen::detail::Chain< Value, First, Second >

Chain - For concatenating the values produced by two Generators.

This type is primarily used through using '+' to combine generators, like:

auto nums = seq(1, 10) + seq(20, 30); int total = nums | sum;

Definition at line 351 of file Core-inl.h.

Constructor & Destructor Documentation

template<class Value , class First , class Second >
folly::gen::detail::Chain< Value, First, Second >::Chain ( First  first,
Second  second 
)
inlineexplicit

Definition at line 356 of file Core-inl.h.

357  : first_(std::move(first)), second_(std::move(second)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
constexpr detail::First first
Definition: Base-inl.h:2553

Member Function Documentation

template<class Value , class First , class Second >
template<class Handler >
bool folly::gen::detail::Chain< Value, First, Second >::apply ( Handler &&  handler) const
inline

Definition at line 360 of file Core-inl.h.

References handler().

360  {
361  return first_.apply(std::forward<Handler>(handler)) &&
362  second_.apply(std::forward<Handler>(handler));
363  }
void handler(int, siginfo_t *, void *)
template<class Value , class First , class Second >
template<class Body >
void folly::gen::detail::Chain< Value, First, Second >::foreach ( Body &&  body) const
inline

Definition at line 366 of file Core-inl.h.

366  {
367  first_.foreach(std::forward<Body>(body));
368  second_.foreach(std::forward<Body>(body));
369  }

Member Data Documentation

template<class Value , class First , class Second >
First folly::gen::detail::Chain< Value, First, Second >::first_
private

Definition at line 352 of file Core-inl.h.

template<class Value , class First , class Second >
constexpr bool folly::gen::detail::Chain< Value, First, Second >::infinite = First::infinite || Second::infinite
static

Definition at line 371 of file Core-inl.h.

template<class Value , class First , class Second >
Second folly::gen::detail::Chain< Value, First, Second >::second_
private

Definition at line 353 of file Core-inl.h.


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