vrpn  07.33
Virtual Reality Peripheral Network
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);
22  ~vrpn_LamportTimestamp (void);
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 
54  vrpn_LamportTimestamp (void);
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 
75  vrpn_LamportTimestamp * getTimestampAndAdvance (void);
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 
class VRPN_API vrpn_LamportClock
Implements a distributed event clock as defined by Leslie Lamport in some seminal papers I can't find...
class VRPN_API vrpn_LamportTimestamp
#define VRPN_API
Timestamp for a single event, produced by a vrpn_LamportClock and hopefully generally usable in place...