proxygen
folly::gen::detail::Filter< Predicate >::Generator< Value, Source > Class Template Reference

#include <Base-inl.h>

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

Public Member Functions

 Generator (Source source, const Predicate &pred)
 
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 Attributes

Source source_
 
Predicate pred_
 

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 Predicate>
template<class Value, class Source>
class folly::gen::detail::Filter< Predicate >::Generator< Value, Source >

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

Constructor & Destructor Documentation

template<class Predicate>
template<class Value , class Source >
folly::gen::detail::Filter< Predicate >::Generator< Value, Source >::Generator ( Source  source,
const Predicate &  pred 
)
inlineexplicit

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

590  : source_(std::move(source)), pred_(pred) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

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

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

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

603  {
604  return source_.apply([&](Value value) -> bool {
605  // NB: Argument not forwarded to avoid accidental move-construction
606  if (pred_(value)) {
607  return handler(std::forward<Value>(value));
608  }
609  return true;
610  });
611  }
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 Predicate>
template<class Value , class Source >
template<class Body >
void folly::gen::detail::Filter< Predicate >::Generator< Value, Source >::foreach ( Body &&  body) const
inline

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

References value, and testing::Value().

593  {
594  source_.foreach([&](Value value) {
595  // NB: Argument not forwarded to avoid accidental move-construction
596  if (pred_(value)) {
597  body(std::forward<Value>(value));
598  }
599  });
600  }
bool Value(const T &value, M matcher)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)

Member Data Documentation

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

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

template<class Predicate>
template<class Value , class Source >
Predicate folly::gen::detail::Filter< Predicate >::Generator< Value, Source >::pred_
private

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

template<class Predicate>
template<class Value , class Source >
Source folly::gen::detail::Filter< Predicate >::Generator< Value, Source >::source_
private

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


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