proxygen
wangle::test::FrameTester Class Reference

#include <CodecTestUtils.h>

Inheritance diagram for wangle::test::FrameTester:
wangle::InboundHandler< std::unique_ptr< folly::IOBuf > > wangle::HandlerBase< InboundHandlerContext< std::unique_ptr< folly::IOBuf > > >

Public Member Functions

 FrameTester (folly::Function< void(std::unique_ptr< folly::IOBuf >)> test)
 
void read (Context *, std::unique_ptr< folly::IOBuf > buf) override
 
void readException (Context *, folly::exception_wrapper) override
 
- Public Member Functions inherited from wangle::InboundHandler< std::unique_ptr< folly::IOBuf > >
 ~InboundHandler () override=default
 
virtual void readEOF (Context *ctx)
 
virtual void transportActive (Context *ctx)
 
virtual void transportInactive (Context *ctx)
 
- Public Member Functions inherited from wangle::HandlerBase< InboundHandlerContext< std::unique_ptr< folly::IOBuf > > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (InboundHandlerContext< std::unique_ptr< folly::IOBuf > > *)
 
virtual void detachPipeline (InboundHandlerContext< std::unique_ptr< folly::IOBuf > > *)
 
InboundHandlerContext< std::unique_ptr< folly::IOBuf > > * getContext ()
 

Private Attributes

folly::Function< void(std::unique_ptr< folly::IOBuf >)> test_
 

Additional Inherited Members

- Public Types inherited from wangle::InboundHandler< std::unique_ptr< folly::IOBuf > >
typedef std::unique_ptr< folly::IOBufrin
 
typedef std::unique_ptr< folly::IOBufrout
 
typedef folly::Unit win
 
typedef folly::Unit wout
 
typedef InboundHandlerContext< std::unique_ptr< folly::IOBuf > > Context
 
- Static Public Attributes inherited from wangle::InboundHandler< std::unique_ptr< folly::IOBuf > >
static const HandlerDir dir
 

Detailed Description

Definition at line 28 of file CodecTestUtils.h.

Constructor & Destructor Documentation

wangle::test::FrameTester::FrameTester ( folly::Function< void(std::unique_ptr< folly::IOBuf >)>  test)
inlineexplicit

Definition at line 31 of file CodecTestUtils.h.

33  : test_(std::move(test)) {}
folly::Function< void(std::unique_ptr< folly::IOBuf >)> test_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

void wangle::test::FrameTester::read ( Context ,
std::unique_ptr< folly::IOBuf buf 
)
inlineoverridevirtual

Implements wangle::InboundHandler< std::unique_ptr< folly::IOBuf > >.

Definition at line 35 of file CodecTestUtils.h.

References folly::gen::move, and test_.

35  {
36  test_(std::move(buf));
37  }
folly::Function< void(std::unique_ptr< folly::IOBuf >)> test_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void wangle::test::FrameTester::readException ( Context ,
folly::exception_wrapper   
)
inlineoverridevirtual

Reimplemented from wangle::InboundHandler< std::unique_ptr< folly::IOBuf > >.

Definition at line 39 of file CodecTestUtils.h.

References test_.

39  {
40  test_(nullptr);
41  }
folly::Function< void(std::unique_ptr< folly::IOBuf >)> test_

Member Data Documentation

folly::Function<void(std::unique_ptr<folly::IOBuf>)> wangle::test::FrameTester::test_
private

Definition at line 44 of file CodecTestUtils.h.

Referenced by read(), and readException().


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