UserApp.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __USERAPP_HPP_
  2. #define __USERAPP_HPP_
  3. #include <iostream>
  4. #include "Util/SqlPool.h"
  5. #include "UtilBase.hpp"
  6. #include "Util/logger.h"
  7. #include "config.hpp"
  8. #include "HttpPlugin.hpp"
  9. #include "TcpPlugin.hpp"
  10. #include "ExpelPlugin.hpp"
  11. #include "MonitorPlugin.hpp"
  12. using namespace std;
  13. using namespace toolkit;
  14. namespace gsd
  15. {
  16. class UserApp
  17. {
  18. private:
  19. UserApp(){
  20. InfoL;
  21. }
  22. public:
  23. using Ptr = std::shared_ptr<UserApp>;
  24. /**
  25. * @description: CreateNew
  26. * @return {*}
  27. */
  28. static std::shared_ptr<UserApp> CreateNew();
  29. /**
  30. * @description: 初始化
  31. * @return {*}
  32. */
  33. virtual bool Init();
  34. /**
  35. * @description: StartTask
  36. * @return {*}
  37. */
  38. virtual bool StartTask();
  39. /**
  40. * @description: 释放
  41. * @return {*}
  42. */
  43. virtual void Destroy();
  44. /**
  45. * @description: Alive
  46. * @return {*}
  47. */
  48. virtual bool Alive();
  49. /**
  50. * @description: ~UserApp
  51. * @return {*}
  52. */
  53. ~UserApp(){
  54. this->Destroy();
  55. }
  56. protected:
  57. HttpPlugin::Ptr m_HttpPlugin = nullptr;
  58. TcpPlugin::Ptr m_TcpPlugin = nullptr;
  59. ExpelPlugin::Ptr m_ExpelPlugin = nullptr;
  60. MonitorPlugin::Ptr m_MonitorPlugin = nullptr;
  61. Timer::Ptr timer0 = nullptr;
  62. };
  63. } // namespace gsd
  64. #endif