blob: f01379dc59cb12870b5d4fcff17016f887aef708 [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
7/**
8 * A processor is a generic object that acts upon two streams of data, one
9 * an input and the other an output. The definition of this object is loose,
10 * though the typical case is for some sort of server that either generates
11 * responses to an input stream or forwards data from one pipe onto another.
12 *
13 * @author Mark Slee <mcslee@facebook.com>
14 */
15class TProcessor {
16 public:
17 virtual ~TProcessor() {}
18 virtual bool process(TTransport* in, TTransport *out) = 0;
19 virtual bool process(TTransport* io) { return process(io, io); }
20 protected:
21 TProcessor() {}
22};
23
24#endif