UserApp.hpp 1.6 KB

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