proxygen
folly::gen::detail::Take Class Reference

#include <Base-inl.h>

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

Classes

class  Generator
 

Public Member Functions

 Take (size_t count)
 
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< Take >
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 count_
 

Additional Inherited Members

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

Detailed Description

Take - For producing up to N values from a source.

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

auto best = from(docs) | orderByDescending(scoreDoc) | take(10);

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

Constructor & Destructor Documentation

folly::gen::detail::Take::Take ( size_t  count)
inlineexplicit

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

697 : count_(count) {}
constexpr detail::Count count
Definition: Base-inl.h:2551

Member Function Documentation

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

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

References folly::gen::move.

730  {
731  return Gen(std::move(source.self()), count_);
732  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Take::compose ( const GenImpl< Value, Source > &  source) const
inline

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

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

735  {
736  return Gen(source.self(), count_);
737  }

Member Data Documentation

size_t folly::gen::detail::Take::count_
private

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


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