proxygen
wangle::StaticPipeline< R, W, Handler, Handlers... > Class Template Reference

#include <StaticPipeline.h>

Inheritance diagram for wangle::StaticPipeline< R, W, Handler, Handlers... >:
wangle::StaticPipeline< R, W, Handlers... >

Public Types

using Ptr = std::shared_ptr< StaticPipeline >
 

Public Member Functions

 ~StaticPipeline () override
 

Static Public Member Functions

template<class... HandlerArgs>
static Ptr create (HandlerArgs &&...handlers)
 

Protected Member Functions

template<class... HandlerArgs>
 StaticPipeline (HandlerArgs &&...handlers)
 
template<class HandlerArg , class... HandlerArgs>
 StaticPipeline (bool isFirst, HandlerArg &&handler, HandlerArgs &&...handlers)
 
void initialize ()
 

Private Member Functions

template<class HandlerArg >
std::enable_if< std::is_same< typename std::remove_reference< HandlerArg >::type, Handler >::value >::type setHandler (HandlerArg &&arg)
 
template<class HandlerArg >
std::enable_if< std::is_same< typename std::decay< HandlerArg >::type, std::shared_ptr< Handler > >::value >::type setHandler (HandlerArg &&arg)
 
template<class HandlerArg >
std::enable_if< std::is_same< typename std::decay< HandlerArg >::type, Handler * >::value >::type setHandler (HandlerArg &&arg)
 

Private Attributes

bool isFirst_
 
std::shared_ptr< HandlerhandlerPtr_
 
ContextType< Handler >::type ctx_
 

Detailed Description

template<class R, class W, class Handler, class... Handlers>
class wangle::StaticPipeline< R, W, Handler, Handlers... >

Definition at line 69 of file StaticPipeline.h.

Member Typedef Documentation

template<class R , class W , class Handler , class... Handlers>
using wangle::StaticPipeline< R, W, Handler, Handlers... >::Ptr = std::shared_ptr<StaticPipeline>

Definition at line 75 of file StaticPipeline.h.

Constructor & Destructor Documentation

template<class R , class W , class Handler , class... Handlers>
wangle::StaticPipeline< R, W, Handler, Handlers... >::~StaticPipeline ( )
inlineoverride
template<class R , class W , class Handler , class... Handlers>
template<class... HandlerArgs>
wangle::StaticPipeline< R, W, Handler, Handlers... >::StaticPipeline ( HandlerArgs &&...  handlers)
inlineexplicitprotected

Definition at line 93 of file StaticPipeline.h.

94  : StaticPipeline(true, std::forward<HandlerArgs>(handlers)...) {
95  isFirst_ = true;
96  }
template<class R , class W , class Handler , class... Handlers>
template<class HandlerArg , class... HandlerArgs>
wangle::StaticPipeline< R, W, Handler, Handlers... >::StaticPipeline ( bool  isFirst,
HandlerArg &&  handler,
HandlerArgs &&...  handlers 
)
inlineprotected

Definition at line 99 of file StaticPipeline.h.

References wangle::PipelineBase::addContextFront(), ctx_, and handler().

103  : StaticPipeline<R, W, Handlers...>(
104  false,
105  std::forward<HandlerArgs>(handlers)...) {
106  isFirst_ = isFirst;
107  setHandler(std::forward<HandlerArg>(handler));
109  }
void addContextFront(Context *ctx)
Definition: Pipeline-inl.h:150
void handler(int, siginfo_t *, void *)
std::enable_if< std::is_same< typename std::remove_reference< HandlerArg >::type, Handler >::value >::type setHandler(HandlerArg &&arg)

Member Function Documentation

template<class R , class W , class Handler , class... Handlers>
template<class... HandlerArgs>
static Ptr wangle::StaticPipeline< R, W, Handler, Handlers... >::create ( HandlerArgs &&...  handlers)
inlinestatic

Definition at line 78 of file StaticPipeline.h.

References ptr.

78  {
79  auto ptr = std::shared_ptr<StaticPipeline>(
80  new StaticPipeline(std::forward<HandlerArgs>(handlers)...));
81  ptr->initialize();
82  return ptr;
83  }
void * ptr
template<class R , class W , class Handler , class... Handlers>
void wangle::StaticPipeline< R, W, Handler, Handlers... >::initialize ( )
inlineprotected

Definition at line 111 of file StaticPipeline.h.

References ctx_, type, and value.

111  {
112  CHECK(handlerPtr_);
113  ctx_.initialize(Pipeline<R, W>::shared_from_this(), handlerPtr_);
114  StaticPipeline<R, W, Handlers...>::initialize();
115  }
template<class R , class W , class Handler , class... Handlers>
template<class HandlerArg >
std::enable_if<std::is_same< typename std::remove_reference<HandlerArg>::type, Handler >::value>::type wangle::StaticPipeline< R, W, Handler, Handlers... >::setHandler ( HandlerArg &&  arg)
inlineprivate

Definition at line 123 of file StaticPipeline.h.

References type, and value.

123  {
124  BaseWithOptional<Handler>::handler_.emplace(std::forward<HandlerArg>(arg));
125  handlerPtr_ = std::shared_ptr<Handler>(
127  [](Handler*){});
128  }
folly::Optional< Handler > handler_
template<class R , class W , class Handler , class... Handlers>
template<class HandlerArg >
std::enable_if<std::is_same< typename std::decay<HandlerArg>::type, std::shared_ptr<Handler> >::value>::type wangle::StaticPipeline< R, W, Handler, Handlers... >::setHandler ( HandlerArg &&  arg)
inlineprivate

Definition at line 135 of file StaticPipeline.h.

References type, and value.

135  {
136  handlerPtr_ = std::forward<HandlerArg>(arg);
137  }
template<class R , class W , class Handler , class... Handlers>
template<class HandlerArg >
std::enable_if<std::is_same< typename std::decay<HandlerArg>::type, Handler* >::value>::type wangle::StaticPipeline< R, W, Handler, Handlers... >::setHandler ( HandlerArg &&  arg)
inlineprivate

Definition at line 144 of file StaticPipeline.h.

144  {
145  handlerPtr_ = std::shared_ptr<Handler>(arg, [](Handler*){});
146  }

Member Data Documentation

template<class R , class W , class Handler , class... Handlers>
ContextType<Handler>::type wangle::StaticPipeline< R, W, Handler, Handlers... >::ctx_
private

Definition at line 150 of file StaticPipeline.h.

template<class R , class W , class Handler , class... Handlers>
std::shared_ptr<Handler> wangle::StaticPipeline< R, W, Handler, Handlers... >::handlerPtr_
private

Definition at line 149 of file StaticPipeline.h.

template<class R , class W , class Handler , class... Handlers>
bool wangle::StaticPipeline< R, W, Handler, Handlers... >::isFirst_
private

Definition at line 148 of file StaticPipeline.h.


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