Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame^] | 1 | #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 | */ |
| 15 | class 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 |