You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
817 B

2 years ago
  1. #pragma once
  2. #include <fstream>
  3. #include <functional>
  4. #include <iostream>
  5. #include <list>
  6. #include <map>
  7. #include <memory>
  8. #include <set>
  9. #include <sstream>
  10. #include <string>
  11. #include <vector>
  12. namespace iflytop {
  13. using namespace std;
  14. class I_XSyncUDP {
  15. public:
  16. typedef function<void(uint32_t ip, int32_t fromport, uint8_t* data, size_t length)> onMessage_t;
  17. public:
  18. virtual int initialize(uint32_t ip, int localport, onMessage_t onMessage) = 0;
  19. virtual void sendto(uint32_t ip, int32_t dest_port, const char* data, int32_t length) = 0;
  20. virtual ~I_XSyncUDP() {}
  21. };
  22. class I_XSyncUDPFactory {
  23. public:
  24. virtual shared_ptr<I_XSyncUDP> create() = 0;
  25. virtual ~I_XSyncUDPFactory() {}
  26. };
  27. class Xsync {
  28. private:
  29. /* data */
  30. public:
  31. Xsync(/* args */);
  32. ~Xsync();
  33. };
  34. } // namespace iflytop