blob: 9562d9fc39a6a363c0df6a2d74711e26f1483bda [file] [log] [blame]
Mark Slee8d7e1f62006-06-07 06:48:56 +00001#ifndef T_NULL_TRANSPORT
2#define T_NULL_TRANSPORT
3
4#include "transport/TTransport.h"
5
6/**
7 * The null transport is a dummy transport that doesn't actually do anything.
8 * It's sort of an analogy to /dev/null, you can never read anything from it
9 * and it will let you write anything you want to it, though it won't actually
10 * go anywhere.
11 *
12 * @author Mark Slee <mcslee@facebook.com>
13 */
14class TNullTransport : public TTransport {
15 public:
16 TNullTransport() {}
17 ~TNullTransport() {}
18
19 bool isOpen() { return true; }
20 void open() { }
21 void write(const std::string& s) {}
22};
23
24#endif