HepuPlugin.hpp 1.1 KB

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