| 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 |  | 
| Marc Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame^] | 7 | namespace facebook { namespace thrift {  | 
 | 8 |  | 
 | 9 | using namespace facebook::thrift::transport; | 
 | 10 |  | 
| Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 11 | /** | 
 | 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 |  */ | 
 | 19 | class 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 Slemko | 6f038a7 | 2006-08-03 18:58:09 +0000 | [diff] [blame^] | 28 | }} // facebook::thrift | 
 | 29 |  | 
| Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 30 | #endif |