#include <dhcpsrv/cfg_option.h>
#include <dhcpsrv/cfg_4o6.h>
#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
#include <string>
namespace isc {
/// @brief Pointer to the @ref Network object.
typedef boost::shared_ptr<Network> NetworkPtr;
+/// @brief Weak pointer to the @ref Network object.
+typedef boost::weak_ptr<Network> WeakNetworkPtr;
+
} // end of namespace isc::dhcp
} // end of namespace isc
template<typename SharedNetworkPtrType>
void getSharedNetwork(SharedNetworkPtrType& shared_network) const {
shared_network = boost::dynamic_pointer_cast<
- typename SharedNetworkPtrType::element_type>(shared_network_);
+ typename SharedNetworkPtrType::element_type>(shared_network_.lock());
}
private:
/// See @ref HRMode type for details.
HRMode host_reservation_mode_;
- NetworkPtr shared_network_;
+ /// @brief Pointer to a shared network that subnet belongs to.
+ WeakNetworkPtr shared_network_;
};
/// @brief A generic pointer to either Subnet4 or Subnet6 object