proxygen
wangle::InboundContextImpl< H > Class Template Reference

#include <HandlerContext-inl.h>

Inheritance diagram for wangle::InboundContextImpl< H >:
wangle::InboundHandlerContext< H::rout > wangle::InboundLink< H::rin > wangle::ContextImplBase< H, InboundHandlerContext< H::rout > > wangle::PipelineContext

Public Types

typedef H::rin Rin
 
typedef H::rout Rout
 
typedef H::win Win
 
typedef H::wout Wout
 

Public Member Functions

 InboundContextImpl (std::weak_ptr< PipelineBase > pipeline, std::shared_ptr< H > handler)
 
 InboundContextImpl ()
 
 ~InboundContextImpl () override=default
 
void fireRead (Rout msg) override
 
void fireReadEOF () override
 
void fireReadException (folly::exception_wrapper e) override
 
void fireTransportActive () override
 
void fireTransportInactive () override
 
PipelineBasegetPipeline () override
 
std::shared_ptr< PipelineBasegetPipelineShared () override
 
void read (Rin msg) override
 
void readEOF () override
 
void readException (folly::exception_wrapper e) override
 
void transportActive () override
 
void transportInactive () override
 
- Public Member Functions inherited from wangle::InboundHandlerContext< H::rout >
virtual ~InboundHandlerContext ()=default
 
std::shared_ptr< folly::AsyncTransportgetTransport ()
 
- Public Member Functions inherited from wangle::ContextImplBase< H, InboundHandlerContext< H::rout > >
 ~ContextImplBase () override=default
 
H * getHandler ()
 
void initialize (std::weak_ptr< PipelineBase > pipeline, std::shared_ptr< H > handler)
 
void attachPipeline () override
 
void detachPipeline () override
 
void setNextIn (PipelineContext *ctx) override
 
void setNextOut (PipelineContext *ctx) override
 
HandlerDir getDirection () override
 
- Public Member Functions inherited from wangle::PipelineContext
virtual ~PipelineContext ()=default
 
template<class H , class HandlerContext >
void attachContext (H *handler, HandlerContext *ctx)
 
template<class H , class HandlerContext >
void detachContext (H *handler, HandlerContext *)
 

Static Public Attributes

static const HandlerDir dir = HandlerDir::IN
 

Additional Inherited Members

- Protected Attributes inherited from wangle::ContextImplBase< H, InboundHandlerContext< H::rout > >
InboundHandlerContext< H::rout > * impl_
 
std::weak_ptr< PipelineBasepipelineWeak_
 
PipelineBasepipelineRaw_
 
std::shared_ptr< H > handler_
 
InboundLink< typename H::rout > * nextIn_
 
OutboundLink< typename H::wout > * nextOut_
 

Detailed Description

template<class H>
class wangle::InboundContextImpl< H >

Definition at line 323 of file HandlerContext-inl.h.

Member Typedef Documentation

template<class H >
typedef H::rin wangle::InboundContextImpl< H >::Rin

Definition at line 328 of file HandlerContext-inl.h.

template<class H >
typedef H::rout wangle::InboundContextImpl< H >::Rout

Definition at line 329 of file HandlerContext-inl.h.

template<class H >
typedef H::win wangle::InboundContextImpl< H >::Win

Definition at line 330 of file HandlerContext-inl.h.

template<class H >
typedef H::wout wangle::InboundContextImpl< H >::Wout

Definition at line 331 of file HandlerContext-inl.h.

Constructor & Destructor Documentation

template<class H >
wangle::InboundContextImpl< H >::InboundContextImpl ( std::weak_ptr< PipelineBase pipeline,
std::shared_ptr< H >  handler 
)
inlineexplicit

Definition at line 334 of file HandlerContext-inl.h.

References folly::gen::move.

336  {
337  this->impl_ = this;
338  this->initialize(pipeline, std::move(handler));
339  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void handler(int, siginfo_t *, void *)
void initialize(std::weak_ptr< PipelineBase > pipeline, std::shared_ptr< H > handler)
template<class H >
wangle::InboundContextImpl< H >::InboundContextImpl ( )
inline

Definition at line 342 of file HandlerContext-inl.h.

342  {
343  this->impl_ = this;
344  }
template<class H >
wangle::InboundContextImpl< H >::~InboundContextImpl ( )
overridedefault

Member Function Documentation

template<class H >
void wangle::InboundContextImpl< H >::fireRead ( Rout  msg)
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 349 of file HandlerContext-inl.h.

References folly::gen::guard(), and folly::WARNING.

349  {
350  auto guard = this->pipelineWeak_.lock();
351  if (this->nextIn_) {
352  this->nextIn_->read(std::forward<Rout>(msg));
353  } else {
354  LOG(WARNING) << "read reached end of pipeline";
355  }
356  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::fireReadEOF ( )
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 358 of file HandlerContext-inl.h.

References folly::gen::guard(), and folly::WARNING.

358  {
359  auto guard = this->pipelineWeak_.lock();
360  if (this->nextIn_) {
361  this->nextIn_->readEOF();
362  } else {
363  LOG(WARNING) << "readEOF reached end of pipeline";
364  }
365  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::fireReadException ( folly::exception_wrapper  e)
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 367 of file HandlerContext-inl.h.

References folly::gen::guard(), folly::gen::move, and folly::WARNING.

367  {
368  auto guard = this->pipelineWeak_.lock();
369  if (this->nextIn_) {
370  this->nextIn_->readException(std::move(e));
371  } else {
372  LOG(WARNING) << "readException reached end of pipeline";
373  }
374  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::fireTransportActive ( )
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 376 of file HandlerContext-inl.h.

References folly::gen::guard().

376  {
377  auto guard = this->pipelineWeak_.lock();
378  if (this->nextIn_) {
379  this->nextIn_->transportActive();
380  }
381  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::fireTransportInactive ( )
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 383 of file HandlerContext-inl.h.

References folly::gen::guard().

383  {
384  auto guard = this->pipelineWeak_.lock();
385  if (this->nextIn_) {
386  this->nextIn_->transportInactive();
387  }
388  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
PipelineBase* wangle::InboundContextImpl< H >::getPipeline ( )
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 390 of file HandlerContext-inl.h.

390  {
391  return this->pipelineRaw_;
392  }
template<class H >
std::shared_ptr<PipelineBase> wangle::InboundContextImpl< H >::getPipelineShared ( )
inlineoverridevirtual

Implements wangle::InboundHandlerContext< H::rout >.

Definition at line 394 of file HandlerContext-inl.h.

394  {
395  return this->pipelineWeak_.lock();
396  }
template<class H >
void wangle::InboundContextImpl< H >::read ( Rin  msg)
inlineoverridevirtual

Implements wangle::InboundLink< H::rin >.

Definition at line 399 of file HandlerContext-inl.h.

References folly::gen::guard().

399  {
400  auto guard = this->pipelineWeak_.lock();
401  this->handler_->read(this, std::forward<Rin>(msg));
402  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::readEOF ( )
inlineoverridevirtual

Implements wangle::InboundLink< H::rin >.

Definition at line 404 of file HandlerContext-inl.h.

References folly::gen::guard().

404  {
405  auto guard = this->pipelineWeak_.lock();
406  this->handler_->readEOF(this);
407  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::readException ( folly::exception_wrapper  e)
inlineoverridevirtual

Implements wangle::InboundLink< H::rin >.

Definition at line 409 of file HandlerContext-inl.h.

References folly::gen::guard(), and folly::gen::move.

409  {
410  auto guard = this->pipelineWeak_.lock();
411  this->handler_->readException(this, std::move(e));
412  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::transportActive ( )
inlineoverridevirtual

Implements wangle::InboundLink< H::rin >.

Definition at line 414 of file HandlerContext-inl.h.

References folly::gen::guard().

414  {
415  auto guard = this->pipelineWeak_.lock();
416  this->handler_->transportActive(this);
417  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840
template<class H >
void wangle::InboundContextImpl< H >::transportInactive ( )
inlineoverridevirtual

Implements wangle::InboundLink< H::rin >.

Definition at line 419 of file HandlerContext-inl.h.

References folly::gen::guard().

419  {
420  auto guard = this->pipelineWeak_.lock();
421  this->handler_->transportInactive(this);
422  }
GuardImpl guard(ErrorHandler &&handler)
Definition: Base.h:840

Member Data Documentation

template<class H >
const HandlerDir wangle::InboundContextImpl< H >::dir = HandlerDir::IN
static

Definition at line 332 of file HandlerContext-inl.h.


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