proxygen
folly::gen::detail::Sample< Random > Class Template Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::Sample< Random >:
folly::gen::Operator< Sample< Random > > folly::gen::FBounded< Self >

Classes

class  Generator
 

Public Member Functions

 Sample (size_t count, Random rng)
 
template<class Source , class Value , class Gen = Generator<Value, Source, Random>>
Gen compose (GenImpl< Value, Source > &&source) const
 
template<class Source , class Value , class Gen = Generator<Value, Source, Random>>
Gen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Sample< Random > >
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

size_t count_
 
Random rng_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::gen::Operator< Sample< Random > >
 Operator ()=default
 
 Operator (Operator &&) noexcept=default
 
 Operator (const Operator &)=default
 
Operatoroperator= (Operator &&) noexcept=default
 
Operatoroperator= (const Operator &)=default
 

Detailed Description

template<class Random>
class folly::gen::detail::Sample< Random >

Sample - For taking a random sample of N elements from a sequence (without replacement).

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

Constructor & Destructor Documentation

template<class Random>
folly::gen::detail::Sample< Random >::Sample ( size_t  count,
Random  rng 
)
inlineexplicit

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

References type, and testing::Value().

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

Member Function Documentation

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

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

References folly::gen::move, and testing::Value().

942  {
943  return Gen(std::move(source.self()), count_, rng_);
944  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Random>
template<class Source , class Value , class Gen = Generator<Value, Source, Random>>
Gen folly::gen::detail::Sample< Random >::compose ( const GenImpl< Value, Source > &  source) const
inline

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

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

950  {
951  return Gen(source.self(), count_, rng_);
952  }

Member Data Documentation

template<class Random>
size_t folly::gen::detail::Sample< Random >::count_
private

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

template<class Random>
Random folly::gen::detail::Sample< Random >::rng_
private

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


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