Add serialization code to idalloc
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include "luastack.hpp"
|
||||
#include "streambuffer.hpp"
|
||||
|
||||
class IdGlobalPool {
|
||||
private:
|
||||
@@ -118,6 +119,12 @@ public:
|
||||
// Allocate an ID for the specified thread. Uses the thread's
|
||||
// batch if possible. If not, fetches one ID from the global pool.
|
||||
int64_t alloc_id_for_thread(lua_State *L);
|
||||
|
||||
// Serialize to a streambuffer.
|
||||
void serialize(StreamBuffer *sb);
|
||||
|
||||
// Deserialize from a streambuffer.
|
||||
void deserialize(StreamBuffer *sb);
|
||||
};
|
||||
|
||||
class IdPlayerPool {
|
||||
@@ -155,6 +162,12 @@ public:
|
||||
|
||||
// Return the size of the queue.
|
||||
int size() { return ranges_.size(); }
|
||||
|
||||
// Serialize to a streambuffer.
|
||||
void serialize(StreamBuffer *sb);
|
||||
|
||||
// Deserialize from a streambuffer.
|
||||
void deserialize(StreamBuffer *sb);
|
||||
};
|
||||
|
||||
#endif // IDALLOC_HPP
|
||||
|
||||
Reference in New Issue
Block a user