4 vrpn_uint32 * vector) :
5 d_timestampSize (vectorLength),
6 d_timestamp (new vrpn_uint32 [vectorLength]) {
11 vrpn_LamportTimestamp::vrpn_LamportTimestamp
13 d_timestampSize (r.d_timestampSize),
14 d_timestamp (
new vrpn_uint32 [r.d_timestampSize]) {
23 delete [] d_timestamp;
31 delete [] d_timestamp;
34 d_timestampSize = r.d_timestampSize;
35 d_timestamp =
new vrpn_uint32 [r.d_timestampSize];
50 if (d_timestampSize != r.d_timestampSize) {
51 return d_timestampSize < r.d_timestampSize;
57 for (i = 0; i < d_timestampSize; i++) {
58 if (d_timestamp[i] > r.d_timestamp[i]) {
63 for (i = 0; i < d_timestampSize; i++) {
64 if (d_timestamp[i] < r.d_timestamp[i]) {
73 if ((i < 0) || (i >= d_timestampSize)) {
76 return d_timestamp[i];
80 return d_timestampSize;
84 void vrpn_LamportTimestamp::copy (
const vrpn_uint32 * vector) {
87 if (d_timestamp && vector) {
88 for (i = 0; i < d_timestampSize; i++) {
89 d_timestamp[i] = vector[i];
97 d_numHosts (numHosts),
98 d_ourIndex (ourIndex),
99 d_currentTimestamp (new vrpn_uint32 [numHosts]) {
103 if (d_currentTimestamp) {
104 for (i = 0; i < numHosts; i++) {
105 d_currentTimestamp[i] = 0;
112 if (d_currentTimestamp) {
113 delete [] d_currentTimestamp;
120 if (r.
size() != d_numHosts) {
125 for (i = 0; i < d_numHosts; i++) {
126 if (r[i] > d_currentTimestamp[i]) {
127 d_currentTimestamp[i] = r[i];
135 d_currentTimestamp[d_ourIndex]++;