vrpn 07.35
Virtual Reality Peripheral Network
 
Loading...
Searching...
No Matches
vrpn_LamportClock.h
Go to the documentation of this file.
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
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
61
62 public:
63
64 vrpn_LamportClock (int numHosts, int ourIndex);
65 ~vrpn_LamportClock (void);
66
67
68 // MANIPULATORS
69
70
71 void receive (const vrpn_LamportTimestamp &);
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
void receive(const vrpn_LamportTimestamp &)
Updates this clock to reflect a timestamp received from another clock/host.
vrpn_LamportClock(int numHosts, int ourIndex)
vrpn_LamportTimestamp * getTimestampAndAdvance(void)
Increments the current timestamp and returns it.
Timestamp for a single event, produced by a vrpn_LamportClock and hopefully generally usable in place...
int size(void) const
Returns the number of hosts participating in the timestamp.
vrpn_LamportTimestamp(int vectorLength, vrpn_uint32 *vector)
#define VRPN_API
class VRPN_API vrpn_LamportClock
class VRPN_API vrpn_LamportTimestamp
bool operator<(const SensorInfo &a, const SensorInfo &b)