]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2348] Doxygen cleanup
authorMarcin Siodelski <marcin@isc.org>
Thu, 20 Oct 2022 19:14:30 +0000 (21:14 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 21 Nov 2022 07:52:02 +0000 (08:52 +0100)
src/lib/dhcpsrv/allocation_state.cc
src/lib/dhcpsrv/allocation_state.h
src/lib/dhcpsrv/iterative_allocation_state.cc
src/lib/dhcpsrv/iterative_allocation_state.h
src/lib/dhcpsrv/iterative_allocator.cc
src/lib/dhcpsrv/iterative_allocator.h

index b759d0a39356335c4a0d227c54c15c8b347267b8..14f88f48a041b443a12b0503981db015a5ad5429 100644 (file)
@@ -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<std::mutex> 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();
 }
 
 }
index 681581bee9ef0b5423c6d8ff90cb4fa52383c5c7..98fcefb025e4c2f4f26521587b939f15bf40b60f 100644 (file)
@@ -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<std::mutex> mutex_;
index ee23b176c550c19fb8b51604066ef38fa6f84428..b165b95b5fda7eac6e28f793bbaf1c5ac21b517d 100644 (file)
@@ -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<std::mutex> 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<std::mutex> 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
index de0cdaa881c9c37878f3d615bedb23f4f1f16d90..50ca973b27207477d38c8a8fdff9f9201df2997d 100644 (file)
@@ -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.
     ///
index 2d1827bffb78889b8fa484e992055c4d07baee9c..f000ddab3f4149c865cdfbddd153524b84d5e087 100644 (file)
@@ -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
index 195fdf7582c56e30d0fef2e7a0135492d3036e98..dc870bc974908355652452a1f432e428b4c4f439 100644 (file)
@@ -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;