Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame^] | 1 | #ifndef T_TRANSPORT_H |
2 | #define T_TRANSPORT_H | ||||
3 | |||||
4 | #include <string> | ||||
5 | |||||
6 | /** | ||||
7 | * Generic interface for a method of transporting data. | ||||
8 | * | ||||
9 | * @author Mark Slee <mcslee@facebook.com> | ||||
10 | */ | ||||
11 | class TTransport { | ||||
12 | public: | ||||
13 | virtual ~TTransport() {}; | ||||
14 | |||||
15 | virtual bool open() = 0; | ||||
16 | virtual void close() = 0; | ||||
17 | |||||
18 | virtual int read (std::string& s, uint32_t size) = 0; | ||||
19 | virtual void write(const std::string& s) = 0; | ||||
20 | |||||
21 | protected: | ||||
22 | TTransport() {}; | ||||
23 | }; | ||||
24 | |||||
25 | #endif |