Diff xmit of ID player pools

This commit is contained in:
2021-07-13 16:34:24 -04:00
parent 1904f03dad
commit 4357fd647f
4 changed files with 196 additions and 24 deletions

View File

@@ -153,9 +153,6 @@ public:
// Refill the fifo of batches from the global pool.
void refill();
// Discard all batches in the fifo. This is only for unit testing.
void purge();
// Get a batch from the fifo. Also refills the fifo.
int64_t get_batch();
@@ -171,10 +168,33 @@ public:
// Return the size of the queue.
int size() { return ranges_.size(); }
// Return true if the two pools are identical.
bool exactly_equal(const IdPlayerPool &other) const;
// Check that the pool is valid.
bool valid() const;
// unit testing functions.
//
// These let you manipulate the deque explicitly. But that's
// only useful for unit testing.
//
void test_push_back(int64_t range);
void test_pop_front();
void test_clear_ranges();
// Serialize to or deserialize from a streambuffer.
// Caution: the pointer to the global pool is not serialized or deserialized.
void serialize(StreamBuffer *sb);
void deserialize(StreamBuffer *sb);
// Difference transmission
//
// When there are no differences, make_patch returns false but
// still writes out a valid patch.
//
bool make_patch(const IdPlayerPool &auth, StreamBuffer *sb) const;
void apply_patch(StreamBuffer *sb);
};
#endif // IDALLOC_HPP