Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
c9094a92
Commit
c9094a92
authored
Aug 31, 2017
by
Marcin Siodelski
Browse files
[5305] Use weak pointer to reference a network from subnet.
parent
47215e37
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/network.h
View file @
c9094a92
...
...
@@ -12,6 +12,7 @@
#include
<dhcpsrv/cfg_option.h>
#include
<dhcpsrv/cfg_4o6.h>
#include
<boost/shared_ptr.hpp>
#include
<boost/weak_ptr.hpp>
#include
<string>
namespace
isc
{
...
...
@@ -95,6 +96,9 @@ protected:
/// @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
...
...
src/lib/dhcpsrv/subnet.h
View file @
c9094a92
...
...
@@ -352,7 +352,7 @@ public:
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:
...
...
@@ -538,7 +538,8 @@ protected:
/// 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment