proxygen
wangle::MockHandler< Rin, Rout, Win, Wout > Class Template Reference

#include <MockHandler.h>

Inheritance diagram for wangle::MockHandler< Rin, Rout, Win, Wout >:
wangle::Handler< Rin, Rout, Win, Wout > wangle::HandlerBase< HandlerContext< Rout, Wout > >

Public Types

typedef Handler< Rin, Rout, Win, Wout >::Context Context
 
- Public Types inherited from wangle::Handler< Rin, Rout, Win, Wout >
typedef Rin rin
 
typedef Rout rout
 
typedef Win win
 
typedef Wout wout
 
typedef HandlerContext< Rout, Wout > Context
 

Public Member Functions

 MockHandler ()=default
 
 MockHandler (MockHandler &&)=default
 
 MOCK_METHOD2_T (read_, void(Context *, Rin &))
 
 MOCK_METHOD1_T (readEOF, void(Context *))
 
 MOCK_METHOD2_T (readException, void(Context *, folly::exception_wrapper))
 
 MOCK_METHOD2_T (write_, void(Context *, Win &))
 
 MOCK_METHOD1_T (close_, void(Context *))
 
 MOCK_METHOD2_T (writeException_, void(Context *, folly::exception_wrapper))
 
 MOCK_METHOD1_T (attachPipeline, void(Context *))
 
 MOCK_METHOD1_T (attachTransport, void(Context *))
 
 MOCK_METHOD1_T (detachPipeline, void(Context *))
 
 MOCK_METHOD1_T (detachTransport, void(Context *))
 
void read (Context *ctx, Rin msg) override
 
folly::Future< folly::Unitwrite (Context *ctx, Win msg) override
 
folly::Future< folly::Unitclose (Context *ctx) override
 
folly::Future< folly::UnitwriteException (Context *ctx, folly::exception_wrapper ex) override
 
- Public Member Functions inherited from wangle::Handler< Rin, Rout, Win, Wout >
 ~Handler () override=default
 
virtual void readEOF (Context *ctx)
 
virtual void readException (Context *ctx, folly::exception_wrapper e)
 
virtual void transportActive (Context *ctx)
 
virtual void transportInactive (Context *ctx)
 
- Public Member Functions inherited from wangle::HandlerBase< HandlerContext< Rout, Wout > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (HandlerContext< Rout, Wout > *)
 
virtual void detachPipeline (HandlerContext< Rout, Wout > *)
 
HandlerContext< Rout, Wout > * getContext ()
 

Additional Inherited Members

- Static Public Attributes inherited from wangle::Handler< Rin, Rout, Win, Wout >
static const HandlerDir dir = HandlerDir::BOTH
 

Detailed Description

template<class Rin, class Rout = Rin, class Win = Rout, class Wout = Rin>
class wangle::MockHandler< Rin, Rout, Win, Wout >

Definition at line 26 of file MockHandler.h.

Member Typedef Documentation

template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
typedef Handler<Rin, Rout, Win, Wout>::Context wangle::MockHandler< Rin, Rout, Win, Wout >::Context

Definition at line 28 of file MockHandler.h.

Constructor & Destructor Documentation

template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MockHandler ( )
default
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MockHandler ( MockHandler< Rin, Rout, Win, Wout > &&  )
default

Member Function Documentation

template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
folly::Future<folly::Unit> wangle::MockHandler< Rin, Rout, Win, Wout >::close ( Context ctx)
inlineoverridevirtual

Reimplemented from wangle::Handler< Rin, Rout, Win, Wout >.

Definition at line 56 of file MockHandler.h.

References folly::makeFutureWith().

56  {
57  return folly::makeFutureWith([&](){
58  close_(ctx);
59  });
60  }
std::enable_if< isFuture< invoke_result_t< F > >::value, invoke_result_t< F > >::type makeFutureWith(F &&func)
Definition: Future-inl.h:1322
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( readEOF  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( close_  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( attachPipeline  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( attachTransport  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( detachPipeline  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD1_T ( detachTransport  ,
void(Context *)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD2_T ( read_  ,
void(Context *, Rin &)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD2_T ( readException  ,
void(Context *, folly::exception_wrapper  
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD2_T ( write_  ,
void(Context *, Win &)   
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
wangle::MockHandler< Rin, Rout, Win, Wout >::MOCK_METHOD2_T ( writeException_  ,
void(Context *, folly::exception_wrapper  
)
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
void wangle::MockHandler< Rin, Rout, Win, Wout >::read ( Context ctx,
Rin  msg 
)
inlineoverridevirtual

Implements wangle::Handler< Rin, Rout, Win, Wout >.

Definition at line 46 of file MockHandler.h.

Referenced by wangle::MockBytesToBytesHandler::defaultFuture().

46  {
47  read_(ctx, msg);
48  }
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
folly::Future<folly::Unit> wangle::MockHandler< Rin, Rout, Win, Wout >::write ( Context ctx,
Win  msg 
)
inlineoverridevirtual

Implements wangle::Handler< Rin, Rout, Win, Wout >.

Definition at line 50 of file MockHandler.h.

References folly::makeFutureWith().

Referenced by wangle::MockBytesToBytesHandler::defaultFuture(), and wangle::MockBytesToBytesHandler::write().

50  {
51  return folly::makeFutureWith([&](){
52  write_(ctx, msg);
53  });
54  }
std::enable_if< isFuture< invoke_result_t< F > >::value, invoke_result_t< F > >::type makeFutureWith(F &&func)
Definition: Future-inl.h:1322
template<class Rin , class Rout = Rin, class Win = Rout, class Wout = Rin>
folly::Future<folly::Unit> wangle::MockHandler< Rin, Rout, Win, Wout >::writeException ( Context ctx,
folly::exception_wrapper  ex 
)
inlineoverridevirtual

Reimplemented from wangle::Handler< Rin, Rout, Win, Wout >.

Definition at line 62 of file MockHandler.h.

References folly::makeFutureWith().

63  {
64  return folly::makeFutureWith([&](){
65  writeException_(ctx, ex);
66  });
67  }
std::enable_if< isFuture< invoke_result_t< F > >::value, invoke_result_t< F > >::type makeFutureWith(F &&func)
Definition: Future-inl.h:1322

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