Hepu.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef __HEPU_H__
  2. #define __HEPU_H__
  3. #include <iostream>
  4. #include <time.h>
  5. #include <ctime>
  6. #include "Util/logger.h"
  7. #include "Util/NoticeCenter.h"
  8. #include "Poller/EventPoller.h"
  9. #include "Util/SqlPool.h"
  10. #include "Network/TcpClient.h"
  11. #include "Poller/Timer.h"
  12. #include "TCPClient.hpp"
  13. #include <httplib.h>
  14. #include "Notices.h"
  15. #include "UtilBase.hpp"
  16. #include "HepuHB.h"
  17. #include "HepuHBRe.h"
  18. #include "HepuLogin.h"
  19. #include "HepuLoginRe.h"
  20. #include "HepuTarget.h"
  21. #include "HepuTargetRe.h"
  22. using namespace std;
  23. namespace gsd{
  24. class Hepu: public enable_shared_from_this<Hepu>, public ModuleBase
  25. {
  26. private:
  27. string username;
  28. string password;
  29. string token;
  30. public:
  31. Hepu(){}
  32. ~Hepu(){}
  33. virtual bool Init(){
  34. return true;
  35. }
  36. virtual void Destroy(){
  37. }
  38. int32_t Init(string username, string url, int port);
  39. static std::shared_ptr<Hepu> CreateNew();
  40. int32_t LoginHepu();
  41. bool alive();
  42. int32_t sendHepuHB(HepuHB& HepuHBMsg);
  43. int32_t sendHepuHB();
  44. int32_t sendHepuTarget(HepuTarget& HepuTargetMsg);
  45. };
  46. };
  47. #endif