proxygen
folly::gen::detail::Order< Selector, Comparer > Class Template Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::Order< Selector, Comparer >:
folly::gen::Operator< Order< Selector, Comparer > > folly::gen::FBounded< Self >

Classes

class  Generator
 

Public Member Functions

 Order ()=default
 
 Order (Selector selector)
 
 Order (Selector selector, Comparer comparer)
 
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< Order< Selector, Comparer > >
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_
 
Comparer comparer_
 

Additional Inherited Members

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

Detailed Description

template<class Selector, class Comparer>
class folly::gen::detail::Order< Selector, Comparer >

Order - For ordering a sequence of values from a source by key. The key is extracted by the given selector functor, and this key is then compared using the specified comparator.

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

auto closest = from(places) | orderBy([](Place& p) { return -distance(p.location, here); }) | take(10);

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

Constructor & Destructor Documentation

template<class Selector , class Comparer >
folly::gen::detail::Order< Selector, Comparer >::Order ( )
default
template<class Selector , class Comparer >
folly::gen::detail::Order< Selector, Comparer >::Order ( Selector  selector)
inlineexplicit

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

1046 : selector_(std::move(selector)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Selector , class Comparer >
folly::gen::detail::Order< Selector, Comparer >::Order ( Selector  selector,
Comparer  comparer 
)
inline

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

References type, and testing::Value().

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

Member Function Documentation

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

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

References folly::gen::move.

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

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

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

1124  {
1125  return Gen(source.self(), selector_, comparer_);
1126  }

Member Data Documentation

template<class Selector , class Comparer >
Comparer folly::gen::detail::Order< Selector, Comparer >::comparer_
private

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

template<class Selector , class Comparer >
Selector folly::gen::detail::Order< Selector, Comparer >::selector_
private

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


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