Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 1 | #ifndef T_SERVER_H |
| 2 | #define T_SERVER_H |
| 3 | |
Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 4 | #include "TProcessor.h" |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 5 | |
| 6 | class TServerOptions; |
| 7 | |
| 8 | /** |
| 9 | * Thrift server. |
| 10 | * |
| 11 | * @author Mark Slee <mcslee@facebook.com> |
| 12 | */ |
| 13 | class TServer { |
| 14 | public: |
| 15 | virtual ~TServer() {} |
| 16 | virtual void run() = 0; |
| 17 | |
| 18 | protected: |
Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 19 | TServer(TProcessor* processor, TServerOptions* options) : |
| 20 | processor_(processor), options_(options) {} |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 21 | |
Mark Slee | 8d7e1f6 | 2006-06-07 06:48:56 +0000 | [diff] [blame] | 22 | TProcessor* processor_; |
Mark Slee | e854063 | 2006-05-30 09:24:40 +0000 | [diff] [blame] | 23 | TServerOptions* options_; |
| 24 | }; |
| 25 | |
| 26 | /** |
| 27 | * Class to encapsulate all generic server options. |
| 28 | */ |
| 29 | class TServerOptions { |
| 30 | public: |
| 31 | // TODO(mcslee): Fill in getters/setters here |
| 32 | protected: |
| 33 | // TODO(mcslee): Fill data members in here |
| 34 | }; |
| 35 | |
| 36 | #endif |