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

#include <Base-inl.h>

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

Classes

class  Generator
 

Public Member Functions

 GroupBy ()
 
 GroupBy (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< GroupBy< 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< GroupBy< 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::GroupBy< Selector >

GroupBy - Group values by a given key selector, producing a sequence of groups.

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

auto bests = from(places) | groupBy([](const Place& p) { return p.city; }) | [](Group<std::string, Place>&& g) { cout << g.key() << ": " << (g | first).description; };

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

Constructor & Destructor Documentation

template<class Selector >
folly::gen::detail::GroupBy< Selector >::GroupBy ( )
inline

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

1149 {}
template<class Selector >
folly::gen::detail::GroupBy< Selector >::GroupBy ( Selector  selector)
inlineexplicit

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

References testing::Key(), type, and testing::Value().

1151 : 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::GroupBy< Selector >::compose ( GenImpl< Value, Source > &&  source) const
inline

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

References folly::gen::move.

1196  {
1197  return Gen(std::move(source.self()), selector_);
1198  }
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::GroupBy< Selector >::compose ( const GenImpl< Value, Source > &  source) const
inline

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

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

1201  {
1202  return Gen(source.self(), selector_);
1203  }

Member Data Documentation

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

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


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