proxygen
folly::gen::detail::Distinct< Selector > Class Template Reference

#include <Base-inl.h>

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

Classes

class  Generator
 

Public Member Functions

 Distinct ()=default
 
 Distinct (Selector selector)
 
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< Distinct< Selector > >
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

Selector selector_
 

Additional Inherited Members

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

Detailed Description

template<class Selector>
class folly::gen::detail::Distinct< Selector >

Distinct - For filtering duplicates out of a sequence. A selector may be provided to generate a key to uniquify for each value.

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

auto closest = from(results) | distinctBy([](Item& i) { return i.target; }) | take(10);

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

Constructor & Destructor Documentation

template<class Selector >
folly::gen::detail::Distinct< Selector >::Distinct ( )
default
template<class Selector >
folly::gen::detail::Distinct< Selector >::Distinct ( Selector  selector)
inlineexplicit

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

1353 : selector_(std::move(selector)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

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

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

References folly::gen::move.

1400  {
1401  return Gen(std::move(source.self()), selector_);
1402  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Selector >
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Distinct< Selector >::compose ( const GenImpl< Value, Source > &  source) const
inline

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

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

1405  {
1406  return Gen(source.self(), selector_);
1407  }

Member Data Documentation

template<class Selector >
Selector folly::gen::detail::Distinct< Selector >::selector_
private

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


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