HepuPlugin.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef __HEPUPLUGHIN_HPP_
  2. #define __HEPUPLUGHIN_HPP_
  3. #include <iostream>
  4. #include "UtilBase.hpp"
  5. #include "Util/util.h"
  6. #include "Util/logger.h"
  7. #include "Util/TimeTicker.h"
  8. #include "Util/NoticeCenter.h"
  9. #include "HttpClient.hpp"
  10. #include "requests.hpp"
  11. #include "Hepu.hpp"
  12. #include "PluginSubscriber.hpp"
  13. #define HEPU_USR "sunwin"
  14. #define HEPU_IP "0.0.0.0"
  15. #define HEPU_PORT 80
  16. using namespace std;
  17. using namespace toolkit;
  18. namespace gsd
  19. {
  20. class HepuPlugin: public PluginSubscriber<HepuPlugin>, public PluginBase
  21. {
  22. private:
  23. HepuPlugin(): PluginBase(){
  24. }
  25. public:
  26. using Ptr = std::shared_ptr<HepuPlugin>;
  27. static std::shared_ptr<HepuPlugin> getPtr();
  28. bool Init();
  29. bool StartTask();
  30. void Destroy();
  31. void HBThrd();
  32. bool Alive();
  33. virtual bool RestPlugin();
  34. ~HepuPlugin(){}
  35. protected:
  36. std::shared_ptr<Hepu> m_hepuClient = nullptr;
  37. std::shared_ptr<ThreadPool> pool = nullptr;
  38. bool stop_ = false;
  39. };
  40. }
  41. #endif