blob: a1f43d4bbe70d79c7eb3ca1311db0daae0ed320e [file] [log] [blame]
Mark Sleee8540632006-05-30 09:24:40 +00001#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 */
11class 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