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

#include <Core-inl.h>

Inheritance diagram for folly::gen::detail::Composed< First, Second >:
folly::gen::Operator< Composed< First, Second > > folly::gen::FBounded< Self >

Public Member Functions

 Composed ()=default
 
 Composed (First first, Second second)
 
template<class Source , class Value , class FirstRet = decltype(std::declval<First>().compose(std::declval<Source>())), class SecondRet = decltype(std::declval<Second>().compose(std::declval<FirstRet>()))>
SecondRet compose (const GenImpl< Value, Source > &source) const
 
template<class Source , class Value , class FirstRet = decltype(std::declval<First>().compose(std::declval<Source>())), class SecondRet = decltype(std::declval<Second>().compose(std::declval<FirstRet>()))>
SecondRet compose (GenImpl< Value, Source > &&source) const
 
- Public Member Functions inherited from folly::gen::Operator< Composed< First, Second > >
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

First first_
 
Second second_
 

Additional Inherited Members

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

Detailed Description

template<class First, class Second>
class folly::gen::detail::Composed< First, Second >

Composed - For building up a pipeline of operations to perform, absent any particular source generator. Useful for building up custom pipelines.

This type is usually used by just piping two operators together:

auto valuesOf = filter([](Optional<int>& o) { return o.hasValue(); }) | map([](Optional<int>& o) -> int& { return o.value(); });

auto valuesIncluded = from(optionals) | valuesOf | as<vector>();

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

Constructor & Destructor Documentation

template<class First , class Second >
folly::gen::detail::Composed< First, Second >::Composed ( )
default
template<class First , class Second >
folly::gen::detail::Composed< First, Second >::Composed ( First  first,
Second  second 
)
inline

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

References testing::Value().

317  : 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 First , class Second >
template<class Source , class Value , class FirstRet = decltype(std::declval<First>().compose(std::declval<Source>())), class SecondRet = decltype(std::declval<Second>().compose(std::declval<FirstRet>()))>
SecondRet folly::gen::detail::Composed< First, Second >::compose ( const GenImpl< Value, Source > &  source) const
inline

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

References folly::gen::detail::First::compose(), folly::gen::FBounded< Self >::self(), and testing::Value().

326  {
327  return second_.compose(first_.compose(source.self()));
328  }
Optional< StorageType > compose(const GenImpl< Value, Source > &source) const
Definition: Base-inl.h:2039
template<class First , class Second >
template<class Source , class Value , class FirstRet = decltype(std::declval<First>().compose(std::declval<Source>())), class SecondRet = decltype(std::declval<Second>().compose(std::declval<FirstRet>()))>
SecondRet folly::gen::detail::Composed< First, Second >::compose ( GenImpl< Value, Source > &&  source) const
inline

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

References folly::gen::detail::First::compose(), and folly::gen::move.

337  {
338  return second_.compose(first_.compose(std::move(source.self())));
339  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Optional< StorageType > compose(const GenImpl< Value, Source > &source) const
Definition: Base-inl.h:2039

Member Data Documentation

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

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

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

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


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