Hepu.hpp 1.3 KB

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