Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_NET_HELIUM_VECTOR_CLOCK_GENERATOR_H_ | |
| 6 #define BLIMP_NET_HELIUM_VECTOR_CLOCK_GENERATOR_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "blimp/net/helium/vector_clock.h" | |
| 10 | |
| 11 namespace blimp { | |
| 12 | |
| 13 // This entity is responsible for generating monotonically increasing values | |
| 14 // of VectorClocks. These generators are going to be used one per host | |
|
Kevin M
2016/10/05 23:41:30
"These generators" - there's only one of them?
scf
2016/10/06 19:47:17
Done.
| |
| 15 // (client or engine) to ensure they have a single clock domain. | |
| 16 // | |
| 17 // This greatly simplify things as VectorClocks will be behaving similar to time | |
|
Kevin M
2016/10/05 23:41:30
Paragraph seems like a design doc detail.
scf
2016/10/06 19:47:17
removed
| |
| 18 // concept. VectorClocks of different objects in the same host can be compared | |
| 19 // directly and well as VectorClocks between different objects in different | |
| 20 // hosts (As long as you invert local and remote pairs). | |
| 21 class VectorClockGenerator { | |
| 22 public: | |
| 23 VectorClockGenerator() {} | |
| 24 | |
| 25 void increment() { clock_.IncrementLocal(); } | |
|
Kevin M
2016/10/05 23:41:30
capital I Increment()
| |
| 26 | |
| 27 const VectorClock& current() { return clock_; } | |
| 28 | |
| 29 private: | |
| 30 VectorClock clock_; | |
| 31 | |
| 32 DISALLOW_COPY_AND_ASSIGN(VectorClockGenerator); | |
| 33 }; | |
| 34 | |
| 35 } // namespace blimp | |
| 36 | |
| 37 #endif // BLIMP_NET_HELIUM_VECTOR_CLOCK_GENERATOR_H_ | |
| OLD | NEW |