20 #include <gmock/gmock.h> 25 template <
class Rin,
class Rout = Rin,
class Win = Rout,
class Wout = Rin>
46 void read(Context* ctx, Rin msg)
override {
65 writeException_(ctx, ex);
70 template <
class R,
class W = R>
87 std::shared_ptr<folly::IOBuf>));
95 std::unique_ptr<folly::IOBuf> buf)
override {
96 std::shared_ptr<folly::IOBuf> sbuf(buf.release());
97 return write(ctx, sbuf).move();
101 return mockClose(ctx).move();
106 return mockWriteException(ctx, ex).move();
virtual void transportInactive(Context *ctx)
folly::MoveWrapper< folly::Future< folly::Unit > > defaultFuture()
Handler< Rin, Rout, Win, Wout >::Context Context
MOCK_METHOD2_T(read_, void(Context *, Rin &))
virtual void attachPipeline(HandlerContext< Rout, Wout > *)
folly::Future< folly::Unit > close(Context *ctx) override
void read(Context *ctx, Rin msg) override
folly::Future< folly::Unit > write(Context *ctx, Win msg) override
virtual void detachPipeline(HandlerContext< Rout, Wout > *)
MOCK_METHOD1_T(readEOF, void(Context *))
folly::Future< folly::Unit > writeException(Context *ctx, folly::exception_wrapper ex) override
folly::Future< folly::Unit > writeException(Context *ctx, folly::exception_wrapper ex) override
#define MOCK_METHOD1(m,...)
folly::Future< folly::Unit > write(Context *ctx, std::unique_ptr< folly::IOBuf > buf) override
virtual void readException(Context *ctx, folly::exception_wrapper e)
#define MOCK_METHOD2(m,...)
virtual void transportActive(Context *ctx)
folly::Future< folly::Unit > close(Context *ctx) override
virtual void readEOF(Context *ctx)
std::enable_if< isFuture< invoke_result_t< F > >::value, invoke_result_t< F > >::type makeFutureWith(F &&func)