proxygen
wangle::MessageToByteEncoder< M > Class Template Referenceabstract

#include <MessageToByteEncoder.h>

Inheritance diagram for wangle::MessageToByteEncoder< M >:
wangle::OutboundHandler< M, std::unique_ptr< folly::IOBuf > > wangle::HandlerBase< OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > >

Public Types

typedef OutboundHandler< M, std::unique_ptr< folly::IOBuf > >::Context Context
 
- Public Types inherited from wangle::OutboundHandler< M, std::unique_ptr< folly::IOBuf > >
typedef folly::Unit rin
 
typedef folly::Unit rout
 
typedef M win
 
typedef std::unique_ptr< folly::IOBufwout
 
typedef OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > Context
 

Public Member Functions

virtual std::unique_ptr< folly::IOBufencode (M &msg)=0
 
folly::Future< folly::Unitwrite (Context *ctx, M msg) override
 
- Public Member Functions inherited from wangle::OutboundHandler< M, std::unique_ptr< folly::IOBuf > >
 ~OutboundHandler () override=default
 
virtual folly::Future< folly::Unitwrite (Context *ctx, Mmsg)=0
 
virtual folly::Future< folly::UnitwriteException (Context *ctx, folly::exception_wrapper e)
 
virtual folly::Future< folly::Unitclose (Context *ctx)
 
- Public Member Functions inherited from wangle::HandlerBase< OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > *)
 
virtual void detachPipeline (OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > *)
 
OutboundHandlerContext< std::unique_ptr< folly::IOBuf > > * getContext ()
 

Additional Inherited Members

- Static Public Attributes inherited from wangle::OutboundHandler< M, std::unique_ptr< folly::IOBuf > >
static const HandlerDir dir
 

Detailed Description

template<typename M>
class wangle::MessageToByteEncoder< M >

An OutboundHandler which encodes message in a stream-like fashion from one message to IOBuf. Inverse of ByteToMessageDecoder.

Definition at line 28 of file MessageToByteEncoder.h.

Member Typedef Documentation

template<typename M>
typedef OutboundHandler<M, std::unique_ptr<folly::IOBuf> >::Context wangle::MessageToByteEncoder< M >::Context

Definition at line 30 of file MessageToByteEncoder.h.

Member Function Documentation

template<typename M>
virtual std::unique_ptr<folly::IOBuf> wangle::MessageToByteEncoder< M >::encode ( M msg)
pure virtual
template<typename M>
folly::Future<folly::Unit> wangle::MessageToByteEncoder< M >::write ( Context ctx,
M  msg 
)
inlineoverride

Definition at line 34 of file MessageToByteEncoder.h.

34  {
35  auto buf = encode(msg);
36  return buf ? ctx->fireWrite(std::move(buf)) : folly::makeFuture();
37  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual std::unique_ptr< folly::IOBuf > encode(M &msg)=0
Future< typename std::decay< T >::type > makeFuture(T &&t)
Definition: Future-inl.h:1310

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