In multi-client setups, it is useful to know which client created which nodeIDs on a shared server. ReadableNodeIDAllocator provides that facility by using a decimal prefix based on the clientID.
make a new instance for given clientID, offset for lowest temporary id, and
clientID |
the clientID for which to create an offset/prefix |
lowestTempID |
the offset for the lowest temporary id |
numClients |
the number of clients for which to split the number range |
the clientID for which to create an offset/prefix
the number of clients for which to split the number range
the offset from where temporary nodeID begin
the offset from where nodeID range begins
the highest permanent nodeID
the number of IDs before the allocator will wrap
allocate next temporary nodeID
allocate next permanent nodeID
free a permanent nodeID
id |
test whether num is in the allocator's range of permanent numbers
num |
reset allocator to initial state