namespace isc {
namespace dhcp {
-SubnetFreeLeaseQueueAllocationStatePtr
-SubnetFreeLeaseQueueAllocationState::create(const SubnetPtr& subnet) {
- auto subnet_prefix = subnet->get();
- return (boost::make_shared<SubnetFreeLeaseQueueAllocationState>());
-}
-
-SubnetFreeLeaseQueueAllocationState::SubnetFreeLeaseQueueAllocationState()
- : SubnetAllocationState() {
-}
-
PoolFreeLeaseQueueAllocationStatePtr
PoolFreeLeaseQueueAllocationState::create(const PoolPtr& pool) {
return (boost::make_shared<PoolFreeLeaseQueueAllocationState>(pool->getType()));
namespace isc {
namespace dhcp {
-/// @brief Forward declaration of the @c SubnetFreeLeaseQueueAllocationState.
-class SubnetFreeLeaseQueueAllocationState;
-
-/// @brief Type of the pointer to the @c SubnetFreeLeaseQueueAllocationState.
-typedef boost::shared_ptr<SubnetFreeLeaseQueueAllocationState> SubnetFreeLeaseQueueAllocationStatePtr;
-
-/// @brief Subnet allocation state used by the FLQ allocator.
-class SubnetFreeLeaseQueueAllocationState : public SubnetAllocationState {
-public:
-
- /// @brief Factory function creating the state instance from subnet.
- ///
- /// @param subnet instance of the subnet for which the allocation
- /// state should be instantiated.
- /// @return new allocation state instance.
- static SubnetFreeLeaseQueueAllocationStatePtr create(const SubnetPtr& subnet);
-
- /// @brief Constructor.
- SubnetFreeLeaseQueueAllocationState();
-};
-
/// @brief Forward declaration of the @c PoolFreeLeaseQueueAllocationState.
class PoolFreeLeaseQueueAllocationState;
.arg(stopwatch.logFormatLastDuration());
}
-SubnetFreeLeaseQueueAllocationStatePtr
-FreeLeaseQueueAllocator::getSubnetState() const {
- auto subnet = subnet_.lock();
- if (!subnet->getAllocationState(pool_type_)) {
- subnet->setAllocationState(pool_type_, SubnetFreeLeaseQueueAllocationState::create(subnet));
- }
- return (boost::dynamic_pointer_cast<SubnetFreeLeaseQueueAllocationState>(subnet->getAllocationState(pool_type_)));
-}
-
PoolFreeLeaseQueueAllocationStatePtr
FreeLeaseQueueAllocator::getPoolState(const PoolPtr& pool) const {
if (!pool->getAllocationState()) {
const isc::asiolink::IOAddress& hint,
uint8_t hint_prefix_length);
- /// @brief Convenience function returning subnet allocation state instance.
- ///
- /// It creates a new subnet state instance and assigns it to the subnet
- /// if it hasn't been initialized.
- ///
- /// @return allocation state instance for the subnet.
- SubnetFreeLeaseQueueAllocationStatePtr getSubnetState() const;
-
/// @brief Convenience function returning pool allocation state instance.
///
/// It creates a new pool state instance and assigns it to the pool