TranImp.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _TRAN_IMP_H_
  2. #define _TRAN_IMP_H_
  3. #include <map>
  4. #include <string>
  5. #include <vector>
  6. #include "servant/Application.h"
  7. using namespace std;
  8. using namespace tars;
  9. /////////////////////////////////////////////////////////////////////////
  10. class TranImp : public Servant {
  11. public:
  12. /**
  13. * 构造函数
  14. */
  15. TranImp();
  16. public:
  17. /**
  18. * 对象初始化
  19. */
  20. virtual void initialize();
  21. /**
  22. * 处理客户端的主动请求
  23. * @param current
  24. * @param response
  25. * @return int
  26. */
  27. virtual int doRequest(tars::CurrentPtr current, vector<char> &response);
  28. /**
  29. * @param resp
  30. * @return int
  31. */
  32. virtual int doResponse(ReqMessagePtr resp);
  33. /**
  34. * 对象销毁
  35. */
  36. virtual void destroy();
  37. protected:
  38. void async_call(tars::CurrentPtr current, vector<char> &response);
  39. protected:
  40. ServantPrx _servantPrx;
  41. };
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #endif