UserApp.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #include "AuditPlugin.hpp"
  13. #include "HepuPlugin.hpp"
  14. using namespace std;
  15. using namespace toolkit;
  16. namespace gsd
  17. {
  18. class UserApp
  19. {
  20. private:
  21. UserApp(){
  22. InfoL;
  23. }
  24. public:
  25. using Ptr = std::shared_ptr<UserApp>;
  26. /**
  27. * @description: CreateNew
  28. * @return {*}
  29. */
  30. static std::shared_ptr<UserApp> CreateNew();
  31. /**
  32. * @description: 初始化
  33. * @return {*}
  34. */
  35. virtual bool Init();
  36. /**
  37. * @description: StartTask
  38. * @return {*}
  39. */
  40. virtual bool StartTask();
  41. /**
  42. * @description: 释放
  43. * @return {*}
  44. */
  45. virtual void Destroy();
  46. /**
  47. * @description: Alive
  48. * @return {*}
  49. */
  50. virtual bool Alive();
  51. /**
  52. * @description: ~UserApp
  53. * @return {*}
  54. */
  55. ~UserApp(){
  56. this->Destroy();
  57. }
  58. protected:
  59. HttpPlugin::Ptr m_HttpPlugin = nullptr;
  60. TcpPlugin::Ptr m_TcpPlugin = nullptr;
  61. ExpelPlugin::Ptr m_ExpelPlugin = nullptr;
  62. MonitorPlugin::Ptr m_MonitorPlugin = nullptr;
  63. AuditPlugin::Ptr m_AuditPlugin = nullptr;
  64. HepuPlugin::Ptr m_HepuPlugin = nullptr;
  65. Timer::Ptr timer0 = nullptr;
  66. };
  67. } // namespace gsd
  68. #endif