SyncTimeMsg.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <iostream>
  3. #include <fstream>
  4. #include <wtypes.h>
  5. using namespace std;
  6. namespace HostServer{
  7. class SyncTimeMsg
  8. {
  9. private:
  10. unsigned long long _localIdCode; // 本节点的id码
  11. unsigned long long _upperIdCode; // 上一级同步节点的id码
  12. unsigned long long _rootIdCode; // 根节点的id码
  13. unsigned short _syncNum; // 时间同步号
  14. unsigned short _syncLevel; // 同步层级
  15. unsigned long long _localStationSendTime; // 本分站的发送时间
  16. unsigned long long _localStationReceiveTime; // 本分站的接收时间
  17. public:
  18. unsigned long long LocalIdCode() const { return _localIdCode; }
  19. void LocalIdCode(unsigned long long val)
  20. {
  21. if(val == 14757395258967641292){
  22. val = 0;
  23. }
  24. _localIdCode = val;
  25. }
  26. unsigned long long UpperIdCode() const { return _upperIdCode; }
  27. void UpperIdCode(unsigned long long val) { _upperIdCode = val; }
  28. unsigned long long RootIdCode() const { return _rootIdCode; }
  29. void RootIdCode(unsigned long long val) { _rootIdCode = val; }
  30. unsigned short SyncNum() const { return _syncNum; }
  31. void SyncNum(unsigned short val) { _syncNum = val; }
  32. unsigned short SyncLevel() const { return _syncLevel; }
  33. void SyncLevel(unsigned short val) { _syncLevel = val; }
  34. unsigned long long LocalStationSendTime() const { return _localStationSendTime; }
  35. void LocalStationSendTime(unsigned long long val) { _localStationSendTime = val; }
  36. unsigned long long LocalStationReceiveTime() const { return _localStationReceiveTime; }
  37. void LocalStationReceiveTime(unsigned long long val) { _localStationReceiveTime = val; }
  38. };
  39. }