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

#include <Base-inl.h>

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

Public Member Functions

 Generator (Source source, size_t count)
 
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_
 
size_t count_
 

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

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

Constructor & Destructor Documentation

template<class Value , class Source >
folly::gen::detail::Skip::Generator< Value, Source >::Generator ( Source  source,
size_t  count 
)
inlineexplicit

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

977  : source_(std::move(source)), count_(count) {}
constexpr detail::Count count
Definition: Base-inl.h:2551
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

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

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

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

996  {
997  if (count_ == 0) {
998  return source_.apply(std::forward<Handler>(handler));
999  }
1000  size_t n = 0;
1001  return source_.apply([&](Value value) -> bool {
1002  if (n < count_) {
1003  ++n;
1004  return true;
1005  }
1006  return handler(std::forward<Value>(value));
1007  });
1008  }
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 Value , class Source >
template<class Body >
void folly::gen::detail::Skip::Generator< Value, Source >::foreach ( Body &&  body) const
inline

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

References value, and testing::Value().

980  {
981  if (count_ == 0) {
982  source_.foreach(body);
983  return;
984  }
985  size_t n = 0;
986  source_.foreach([&](Value value) {
987  if (n < count_) {
988  ++n;
989  } else {
990  body(std::forward<Value>(value));
991  }
992  });
993  }
bool Value(const T &value, M matcher)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)

Member Data Documentation

template<class Value , class Source >
size_t folly::gen::detail::Skip::Generator< Value, Source >::count_
private

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

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

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

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

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


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