Kea 1.5.0
assignable_network.h
Go to the documentation of this file.
1// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ASSIGNABLE_NETWORK_H
8#define ASSIGNABLE_NETWORK_H
9
10#include <dhcpsrv/network.h>
11
12namespace isc {
13namespace dhcp {
14
24protected:
25
27 virtual ~AssignableNetwork() { }
28
36
42 template<typename SubnetPtr>
43 void setSharedNetwork(const SubnetPtr& subnet) {
44 subnet->setSharedNetwork(sharedFromThis());
45 }
46
53 template<typename SubnetPtr>
54 void clearSharedNetwork(const SubnetPtr& subnet) {
55 subnet->setSharedNetwork(NetworkPtr());
56 }
57};
58
59} // end of namespace isc::dhcp
60} // end of namespace isc
61
62#endif // ASSIGNABLE_NETWORK_H
Represents a network that can be associated with a subnet.
void setSharedNetwork(const SubnetPtr &subnet)
Associates a subnet with this network.
virtual NetworkPtr sharedFromThis()=0
Returns shared pointer to this object.
void clearSharedNetwork(const SubnetPtr &subnet)
Removes association of a subnet with a network.
virtual ~AssignableNetwork()
Virtual destructor.
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
Definition: subnet.h:455
boost::shared_ptr< Network > NetworkPtr
Pointer to the Network object.
Definition: network.h:360
Defines the logger used by the top-level component of kea-dhcp-ddns.