RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_LamportClock.h
1#ifndef VRPN_LAMPORT_CLOCK_H
2#define VRPN_LAMPORT_CLOCK_H
3
4#include "vrpn_Configure.h" // for VRPN_API
5#include "vrpn_Types.h" // for vrpn_uint32, vrpn_bool
6
10
15
16class VRPN_API vrpn_LamportTimestamp {
17
18 public:
19
20 vrpn_LamportTimestamp (int vectorLength, vrpn_uint32 * vector);
23
24 vrpn_LamportTimestamp & operator = (const vrpn_LamportTimestamp &);
25
26
27 // ACCESSORS
28
29
30 vrpn_bool operator < (const vrpn_LamportTimestamp & r) const;
34
35
36 // Utility functions.
37
38 vrpn_uint32 operator [] (int i) const;
40
41 int size (void) const;
43
44
45 private:
46
47 void copy (const vrpn_uint32 *);
50
51 int d_timestampSize;
52 vrpn_uint32 * d_timestamp;
53
56
57};
58
59
60class VRPN_API vrpn_LamportClock {
61
62 public:
63
64 vrpn_LamportClock (int numHosts, int ourIndex);
65 ~vrpn_LamportClock (void);
66
67
68 // MANIPULATORS
69
70
74
77
78
79 private:
80
81 int d_numHosts;
82 int d_ourIndex;
83 vrpn_uint32 * d_currentTimestamp;
84
85};
86
87
88
89#endif // VRPN_LAMPORT_CLOCK_H
90
91
定义 vrpn_LamportClock.h:60
void receive(const vrpn_LamportTimestamp &)
vrpn_LamportTimestamp * getTimestampAndAdvance(void)
Increments the current timestamp and returns it.
定义 vrpn_LamportClock.h:16
int size(void) const
Returns the number of hosts participating in the timestamp.