Class | AMQP::IntAllocator |
In: |
lib/amqp/int_allocator.rb
|
Parent: | Object |
hi | [R] | @return [Integer] Upper boundary of the integer range available for allocation |
lo | [R] | @return [Integer] Lower boundary of the integer range available for allocation |
number_of_bits | [R] | @return [Integer] Number of integers in the allocation range |
@param [Integer] lo Lower boundary of the integer range available for allocation @param [Integer] hi Upper boundary of the integer range available for allocation @raise [ArgumentError] if upper boundary is not greater than the lower one
Attempts to allocate next available integer. If allocation succeeds, allocated value is returned. Otherwise, nil is returned.
Current implementation of this method is O(n), where n is number of bits in the range available for allocation.
@return [Integer] Allocated integer if allocation succeeded. nil otherwise.
Releases previously allocated integer. If integer provided as argument was not previously allocated, this method has no effect.
@return [NilClass] nil