proxygen
folly::gen::VirtualGen< Value > Class Template Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::VirtualGen< Value >:
folly::gen::GenImpl< Value, VirtualGen< Value > > folly::gen::FBounded< Self >

Classes

class  WrapperBase
 
class  WrapperImpl
 

Public Member Functions

template<class Self >
 VirtualGen (Self source)
 
 VirtualGen (VirtualGen &&source) noexcept
 
 VirtualGen (const VirtualGen &source)
 
VirtualGenoperator= (const VirtualGen &source)
 
VirtualGenoperator= (VirtualGen &&source) noexcept
 
bool apply (const std::function< bool(Value)> &handler) const
 
void foreach (const std::function< void(Value)> &body) const
 
- Public Member Functions inherited from folly::gen::GenImpl< Value, VirtualGen< Value > >
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 ()
 

Private Attributes

std::unique_ptr< const WrapperBasewrapper_
 

Additional Inherited Members

- Public Types inherited from folly::gen::GenImpl< Value, VirtualGen< Value > >
typedef Value ValueType
 
typedef std::decay< Value >::type StorageType
 
- Static Public Attributes inherited from folly::gen::GenImpl< Value, VirtualGen< Value > >
static constexpr bool infinite
 
- Protected Member Functions inherited from folly::gen::GenImpl< Value, VirtualGen< Value > >
 GenImpl ()=default
 
 GenImpl (GenImpl &&)=default
 
 GenImpl (const GenImpl &)=default
 
GenImploperator= (GenImpl &&)=default
 
GenImploperator= (const GenImpl &)=default
 

Detailed Description

template<class Value>
class folly::gen::VirtualGen< Value >

VirtualGen<T> - For wrapping template types in simple polymorphic wrapper.

Polymorphic wrapper

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

Constructor & Destructor Documentation

template<class Value>
template<class Self >
folly::gen::VirtualGen< Value >::VirtualGen ( Self  source)
inline

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

2519  : wrapper_(new WrapperImpl<Self>(std::move(source))) {}
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Value>
folly::gen::VirtualGen< Value >::VirtualGen ( VirtualGen< Value > &&  source)
inlinenoexcept

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

2522  : wrapper_(std::move(source.wrapper_)) {}
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Value>
folly::gen::VirtualGen< Value >::VirtualGen ( const VirtualGen< Value > &  source)
inline

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

2524 : wrapper_(source.wrapper_->clone()) {}
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514

Member Function Documentation

template<class Value>
bool folly::gen::VirtualGen< Value >::apply ( const std::function< bool(Value)> &  handler) const
inline

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

References handler().

2536  {
2537  return wrapper_->apply(handler);
2538  }
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
void handler(int, siginfo_t *, void *)
template<class Value>
void folly::gen::VirtualGen< Value >::foreach ( const std::function< void(Value)> &  body) const
inline

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

2540  {
2541  wrapper_->foreach(body);
2542  }
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
template<class Value>
VirtualGen& folly::gen::VirtualGen< Value >::operator= ( const VirtualGen< Value > &  source)
inline

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

References folly::gen::VirtualGen< Value >::wrapper_.

2526  {
2527  wrapper_.reset(source.wrapper_->clone());
2528  return *this;
2529  }
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
template<class Value>
VirtualGen& folly::gen::VirtualGen< Value >::operator= ( VirtualGen< Value > &&  source)
inlinenoexcept

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

References folly::gen::move.

2531  {
2532  wrapper_ = std::move(source.wrapper_);
2533  return *this;
2534  }
std::unique_ptr< const WrapperBase > wrapper_
Definition: Base-inl.h:2514
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Data Documentation

template<class Value>
std::unique_ptr<const WrapperBase> folly::gen::VirtualGen< Value >::wrapper_
private

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

Referenced by folly::gen::VirtualGen< Value >::operator=().


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