proxygen
folly::gen::detail::Distinct< Selector >::Generator< Value, Source > Class Template Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::Distinct< Selector >::Generator< Value, Source >:
folly::gen::GenImpl< Value, Generator< Value, Source > > folly::gen::FBounded< Self >

Public Member Functions

 Generator (Source source, Selector selector)
 
template<class Body >
void foreach (Body &&body) const
 
template<class Handler >
bool apply (Handler &&handler) const
 
- Public Member Functions inherited from folly::gen::GenImpl< Value, Generator< Value, Source > >
bool apply (Handler &&handler) const
 
void foreach (Body &&body) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Static Public Attributes

static constexpr bool infinite = Source::infinite
 
- Static Public Attributes inherited from folly::gen::GenImpl< Value, Generator< Value, Source > >
static constexpr bool infinite
 

Private Types

typedef std::decay< Value >::type StorageType
 
typedef const StorageTypeParamType
 
typedef invoke_result_t< Selector, ParamTypeKeyType
 
typedef std::decay< KeyType >::type KeyStorageType
 

Private Attributes

Source source_
 
Selector selector_
 

Additional Inherited Members

- Public Types inherited from folly::gen::GenImpl< Value, Generator< Value, Source > >
typedef Value ValueType
 
typedef std::decay< Value >::type StorageType
 
- Protected Member Functions inherited from folly::gen::GenImpl< Value, Generator< Value, Source > >
 GenImpl ()=default
 
 GenImpl (GenImpl &&)=default
 
 GenImpl (const GenImpl &)=default
 
GenImploperator= (GenImpl &&)=default
 
GenImploperator= (const GenImpl &)=default
 

Detailed Description

template<class Selector>
template<class Value, class Source>
class folly::gen::detail::Distinct< Selector >::Generator< Value, Source >

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

Member Typedef Documentation

template<class Selector >
template<class Value , class Source >
typedef std::decay<KeyType>::type folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::KeyStorageType
private

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

template<class Selector >
template<class Value , class Source >
typedef invoke_result_t<Selector, ParamType> folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::KeyType
private

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

template<class Selector >
template<class Value , class Source >
typedef const StorageType& folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::ParamType
private

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

template<class Selector >
template<class Value , class Source >
typedef std::decay<Value>::type folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::StorageType
private

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

Constructor & Destructor Documentation

template<class Selector >
template<class Value , class Source >
folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::Generator ( Source  source,
Selector  selector 
)
inline

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

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

Member Function Documentation

template<class Selector >
template<class Value , class Source >
template<class Handler >
bool folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::apply ( Handler &&  handler) const
inline

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

References handler(), value, and testing::Value().

1384  {
1385  std::unordered_set<KeyStorageType> keysSeen;
1386  return source_.apply([&](Value value) -> bool {
1387  if (keysSeen.insert(selector_(ParamType(value))).second) {
1388  return handler(std::forward<Value>(value));
1389  }
1390  return true;
1391  });
1392  }
void handler(int, siginfo_t *, void *)
bool Value(const T &value, M matcher)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<class Selector >
template<class Value , class Source >
template<class Body >
void folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::foreach ( Body &&  body) const
inline

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

References value, and testing::Value().

1374  {
1375  std::unordered_set<KeyStorageType> keysSeen;
1376  source_.foreach([&](Value value) {
1377  if (keysSeen.insert(selector_(ParamType(value))).second) {
1378  body(std::forward<Value>(value));
1379  }
1380  });
1381  }
bool Value(const T &value, M matcher)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)

Member Data Documentation

template<class Selector >
template<class Value , class Source >
constexpr bool folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::infinite = Source::infinite
static

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

template<class Selector >
template<class Value , class Source >
Selector folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::selector_
private

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

template<class Selector >
template<class Value , class Source >
Source folly::gen::detail::Distinct< Selector >::Generator< Value, Source >::source_
private

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


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