Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 7e89ade1bc38c6510e245de164bf9b76c37f54b8 Mon Sep 17 00:00:00 2001
- From: Marcin Siodelski <[email protected]>
- Date: Thu, 3 Oct 2013 12:02:34 +0200
- Subject: [PATCH] [3171] non-const variant of getPools is renamed and made
- private.
- ---
- src/lib/dhcpsrv/subnet.cc | 6 +++---
- src/lib/dhcpsrv/subnet.h | 11 +++++++++--
- 2 files changed, 12 insertions(+), 5 deletions(-)
- diff --git a/src/lib/dhcpsrv/subnet.cc b/src/lib/dhcpsrv/subnet.cc
- index 8e51906..4320733 100644
- --- a/src/lib/dhcpsrv/subnet.cc
- +++ b/src/lib/dhcpsrv/subnet.cc
- @@ -169,7 +169,7 @@ const PoolCollection& Subnet::getPools(Lease::Type type) const {
- }
- }
- -PoolCollection& Subnet::getPools(Lease::Type type) {
- +PoolCollection& Subnet::getPoolsWritable(Lease::Type type) {
- // check if the type is valid (and throw if it isn't)
- checkType(type);
- @@ -230,12 +230,12 @@ Subnet::addPool(const PoolPtr& pool) {
- checkType(pool->getType());
- // Add the pool to the appropriate pools collection
- - getPools(pool->getType()).push_back(pool);
- + getPoolsWritable(pool->getType()).push_back(pool);
- }
- void
- Subnet::delPools(Lease::Type type) {
- - getPools(type).clear();
- + getPoolsWritable(type).clear();
- }
- void
- diff --git a/src/lib/dhcpsrv/subnet.h b/src/lib/dhcpsrv/subnet.h
- index 2354834..664ae4e 100644
- --- a/src/lib/dhcpsrv/subnet.h
- +++ b/src/lib/dhcpsrv/subnet.h
- @@ -319,13 +319,20 @@ public:
- /// @return a collection of all pools
- const PoolCollection& getPools(Lease::Type type) const;
- - /// @brief Returns all pools (variable variant)
- +private:
- +
- + /// @brief Returns all pools (non-const variant)
- ///
- /// The reference is only valid as long as the object that returned it.
- + /// The reference returned can be used to modify pools stored in the
- + /// collection. This method is meant to be called internally from the
- + /// @c Subnet class.
- ///
- /// @param type lease type to be set
- /// @return a collection of all pools
- - PoolCollection& getPools(Lease::Type type);
- + PoolCollection& getPoolsWritable(Lease::Type type);
- +
- +public:
- /// @brief Sets name of the network interface for directly attached networks
- ///
- --
- 1.8.1.2
Advertisement
Add Comment
Please, Sign In to add comment