blob: 2ed243041ffc4bbbc370058ba15937d9874d055a [file] [log] [blame]
Mark Slee8d7e1f62006-06-07 06:48:56 +00001#ifndef T_PROCESSOR_H
2#define T_PROCESSOR_H
3
4#include <string>
5#include "transport/TTransport.h"
6
Marc Slemko6f038a72006-08-03 18:58:09 +00007namespace facebook { namespace thrift {
8
9using namespace facebook::thrift::transport;
10
Mark Slee8d7e1f62006-06-07 06:48:56 +000011/**
12 * A processor is a generic object that acts upon two streams of data, one
13 * an input and the other an output. The definition of this object is loose,
14 * though the typical case is for some sort of server that either generates
15 * responses to an input stream or forwards data from one pipe onto another.
16 *
17 * @author Mark Slee <mcslee@facebook.com>
18 */
19class TProcessor {
20 public:
21 virtual ~TProcessor() {}
22 virtual bool process(TTransport* in, TTransport *out) = 0;
23 virtual bool process(TTransport* io) { return process(io, io); }
24 protected:
25 TProcessor() {}
26};
27
Marc Slemko6f038a72006-08-03 18:58:09 +000028}} // facebook::thrift
29
Mark Slee8d7e1f62006-06-07 06:48:56 +000030#endif