From: Marcin Siodelski Date: Thu, 20 Oct 2022 19:14:30 +0000 (+0200) Subject: [#2348] Doxygen cleanup X-Git-Tag: Kea-2.3.3~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeca6de494fd0b143c13c49ca0f296eeccb90130;p=thirdparty%2Fkea.git [#2348] Doxygen cleanup --- diff --git a/src/lib/dhcpsrv/allocation_state.cc b/src/lib/dhcpsrv/allocation_state.cc index b759d0a393..14f88f48a0 100644 --- a/src/lib/dhcpsrv/allocation_state.cc +++ b/src/lib/dhcpsrv/allocation_state.cc @@ -24,18 +24,18 @@ SubnetAllocationState::SubnetAllocationState() } boost::posix_time::ptime -SubnetAllocationState::getLastAllocatedTime(const Lease::Type& lease_type) const { +SubnetAllocationState::getLastAllocatedTime(Lease::Type type) const { if (MultiThreadingMgr::instance().getMode()) { std::lock_guard lock(*mutex_); - return (getLastAllocatedTimeInternal(lease_type)); + return (getLastAllocatedTimeInternal(type)); } else { - return (getLastAllocatedTimeInternal(lease_type)); + return (getLastAllocatedTimeInternal(type)); } } boost::posix_time::ptime -SubnetAllocationState::getLastAllocatedTimeInternal(const Lease::Type& lease_type) const { - auto t = last_allocated_time_.find(lease_type); +SubnetAllocationState::getLastAllocatedTimeInternal(Lease::Type type) const { + auto t = last_allocated_time_.find(type); if (t != last_allocated_time_.end()) { return (t->second); } @@ -46,8 +46,8 @@ SubnetAllocationState::getLastAllocatedTimeInternal(const Lease::Type& lease_typ } void -SubnetAllocationState::setCurrentAllocatedTimeInternal(const Lease::Type& lease_type) { - last_allocated_time_[lease_type] = boost::posix_time::microsec_clock::universal_time(); +SubnetAllocationState::setCurrentAllocatedTimeInternal(Lease::Type type) { + last_allocated_time_[type] = boost::posix_time::microsec_clock::universal_time(); } } diff --git a/src/lib/dhcpsrv/allocation_state.h b/src/lib/dhcpsrv/allocation_state.h index 681581bee9..98fcefb025 100644 --- a/src/lib/dhcpsrv/allocation_state.h +++ b/src/lib/dhcpsrv/allocation_state.h @@ -55,13 +55,13 @@ public: /// @brief Returns last allocation time for the specified lease type. /// - /// @param lease_type specifies a lease type for which the last - /// allocation time should be returned. + /// @param type specifies a lease type for which the last allocation + /// time should be returned. /// @return Last allocation time for the lease type or /// @c boost::posix_time::neg_infin when no leases have been allocated /// from this subnet yet. boost::posix_time::ptime - getLastAllocatedTime(const Lease::Type& lease_type) const; + getLastAllocatedTime(Lease::Type type) const; protected: @@ -70,9 +70,9 @@ protected: /// This function should be called by derived classes. It should be /// called in the thread-safe context. /// - /// @param lease_type specifies a lease type for which the last allocation + /// @param type specifies a lease type for which the last allocation /// time should be set to the current time. - void setCurrentAllocatedTimeInternal(const Lease::Type& lease_type); + void setCurrentAllocatedTimeInternal(Lease::Type type); /// @brief Returns the last allocation time of a specified lease type. /// @@ -85,7 +85,7 @@ protected: /// this subnet. The negative infinity time is returned if a lease type is /// not recognized (which is unlikely). boost::posix_time::ptime - getLastAllocatedTimeInternal(const Lease::Type& lease_type) const; + getLastAllocatedTimeInternal(Lease::Type type) const; /// @brief Mutex used for thread-safe access to the state members. boost::scoped_ptr mutex_; diff --git a/src/lib/dhcpsrv/iterative_allocation_state.cc b/src/lib/dhcpsrv/iterative_allocation_state.cc index ee23b176c5..b165b95b5f 100644 --- a/src/lib/dhcpsrv/iterative_allocation_state.cc +++ b/src/lib/dhcpsrv/iterative_allocation_state.cc @@ -32,28 +32,28 @@ SubnetIterativeAllocationState::SubnetIterativeAllocationState(const IOAddress& } IOAddress -SubnetIterativeAllocationState::getLastAllocated(const Lease::Type& lease_type) const { +SubnetIterativeAllocationState::getLastAllocated(Lease::Type type) const { if (MultiThreadingMgr::instance().getMode()) { std::lock_guard lock(*mutex_); - return (getLastAllocatedInternal(lease_type)); + return (getLastAllocatedInternal(type)); } else { - return (getLastAllocatedInternal(lease_type)); + return (getLastAllocatedInternal(type)); } } void -SubnetIterativeAllocationState::setLastAllocated(const Lease::Type& lease_type, const IOAddress& address) { +SubnetIterativeAllocationState::setLastAllocated(Lease::Type type, const IOAddress& address) { if (MultiThreadingMgr::instance().getMode()) { std::lock_guard lock(*mutex_); - setLastAllocatedInternal(lease_type, address); + setLastAllocatedInternal(type, address); } else { - setLastAllocatedInternal(lease_type, address); + setLastAllocatedInternal(type, address); } } IOAddress -SubnetIterativeAllocationState::getLastAllocatedInternal(const Lease::Type& lease_type) const { - switch (lease_type) { +SubnetIterativeAllocationState::getLastAllocatedInternal(Lease::Type type) const { + switch (type) { case Lease::TYPE_V4: case Lease::TYPE_NA: return last_allocated_ia_; @@ -62,14 +62,14 @@ SubnetIterativeAllocationState::getLastAllocatedInternal(const Lease::Type& leas case Lease::TYPE_PD: return last_allocated_pd_; default: - isc_throw(BadValue, "pool type " << lease_type << " not supported"); + isc_throw(BadValue, "pool type " << type << " not supported"); } } void -SubnetIterativeAllocationState::setLastAllocatedInternal(const Lease::Type& lease_type, +SubnetIterativeAllocationState::setLastAllocatedInternal(Lease::Type type, const IOAddress& address) { - switch (lease_type) { + switch (type) { case Lease::TYPE_V4: case Lease::TYPE_NA: last_allocated_ia_ = address; @@ -81,11 +81,11 @@ SubnetIterativeAllocationState::setLastAllocatedInternal(const Lease::Type& leas last_allocated_pd_ = address; break; default: - isc_throw(BadValue, "pool type " << lease_type << " not supported"); + isc_throw(BadValue, "pool type " << type << " not supported"); } // Update the timestamp of last allocation. - setCurrentAllocatedTimeInternal(lease_type); + setCurrentAllocatedTimeInternal(type); } PoolIterativeAllocationStatePtr diff --git a/src/lib/dhcpsrv/iterative_allocation_state.h b/src/lib/dhcpsrv/iterative_allocation_state.h index de0cdaa881..50ca973b27 100644 --- a/src/lib/dhcpsrv/iterative_allocation_state.h +++ b/src/lib/dhcpsrv/iterative_allocation_state.h @@ -49,15 +49,15 @@ public: /// @brief Returns last allocated address or prefix. /// - /// @param lease_type type of the last allocated lease to be returned. + /// @param type type of the last allocated lease to be returned. /// @return last allocated address or prefix of a given type. - asiolink::IOAddress getLastAllocated(const Lease::Type& lease_type) const; + asiolink::IOAddress getLastAllocated(Lease::Type type) const; /// @brief Sets last alocated address or prefix. /// - /// @param lease_type type of the last allocated lease set. + /// @param type type of the last allocated lease set. /// @param address an address or prefix last allocated. - void setLastAllocated(const Lease::Type& lease_type, const asiolink::IOAddress& address); + void setLastAllocated(Lease::Type type, const asiolink::IOAddress& address); private: @@ -65,17 +65,17 @@ private: /// /// It must be called in the thread-safe context. /// - /// @param lease_type type of the last allocated lease to be returned. + /// @param type type of the last allocated lease to be returned. /// @return last allocated address or prefix of a given type. - asiolink::IOAddress getLastAllocatedInternal(const Lease::Type& lease_type) const; + asiolink::IOAddress getLastAllocatedInternal(Lease::Type type) const; /// @brief Sets last alocated address or prefix. /// /// It must be called in the thread-safe context. /// - /// @param lease_type type of the last allocated lease set. + /// @param type type of the last allocated lease set. /// @param address an address or prefix last allocated. - void setLastAllocatedInternal(const Lease::Type& lease_type, const asiolink::IOAddress& address); + void setLastAllocatedInternal(Lease::Type type, const asiolink::IOAddress& address); /// @brief Last allocated address. /// diff --git a/src/lib/dhcpsrv/iterative_allocator.cc b/src/lib/dhcpsrv/iterative_allocator.cc index 2d1827bffb..f000ddab3f 100644 --- a/src/lib/dhcpsrv/iterative_allocator.cc +++ b/src/lib/dhcpsrv/iterative_allocator.cc @@ -17,9 +17,9 @@ using namespace std; namespace isc { namespace dhcp { -IterativeAllocator::IterativeAllocator(const Lease::Type& lease_type, +IterativeAllocator::IterativeAllocator(Lease::Type type, const WeakSubnetPtr& subnet) - : Allocator(lease_type, subnet) { + : Allocator(type, subnet) { } isc::asiolink::IOAddress diff --git a/src/lib/dhcpsrv/iterative_allocator.h b/src/lib/dhcpsrv/iterative_allocator.h index 195fdf7582..dc870bc974 100644 --- a/src/lib/dhcpsrv/iterative_allocator.h +++ b/src/lib/dhcpsrv/iterative_allocator.h @@ -27,9 +27,9 @@ public: /// @brief Constructor. /// - /// @param lease_type specifies the type of allocated leases. + /// @param type specifies the type of allocated leases. /// @param subnet weak pointer to the subnet owning the allocator. - IterativeAllocator(const Lease::Type& lease_type, const WeakSubnetPtr& subnet); + IterativeAllocator(Lease::Type type, const WeakSubnetPtr& subnet); private: @@ -48,12 +48,17 @@ private: /// @brief Convenience function returning subnet allocation state instance. /// - /// @param subnet subnet 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. SubnetIterativeAllocationStatePtr getSubnetState() const; /// @brief Convenience function returning pool allocation state instance. /// + /// It creates a new pool state instance and assigns it to the pool + /// if it hasn't been initialized. + /// /// @param pool pool instance. /// @return allocation state instance for the pool. PoolIterativeAllocationStatePtr getPoolState(const PoolPtr& pool) const;