Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 1 | #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 | */ |
| 14 | class 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 |