Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame^] | 1 | #ifndef T_DISPATCHER_H |
| 2 | #define T_DISPATCHER_H |
| 3 | |
| 4 | #include <string> |
| 5 | |
| 6 | /** |
| 7 | * A dispatcher is a generic object that accepts an input buffer and returns |
| 8 | * a buffer. It can be used in a variety of ways, i.e. as a client that |
| 9 | * sends data over the network and returns a response, or as a server that |
| 10 | * reads an input and returns an output. |
| 11 | * |
| 12 | * @author Mark Slee <mcslee@facebook.com> |
| 13 | */ |
| 14 | class TDispatcher { |
| 15 | public: |
| 16 | virtual ~TDispatcher() {}; |
| 17 | virtual std::string dispatch(const std::string& s) = 0; |
| 18 | protected: |
| 19 | TDispatcher() {} |
| 20 | }; |
| 21 | |
| 22 | #endif |