Kea  1.9.9-git
config_backend_dhcp4_mgr.cc
Go to the documentation of this file.
1 // Copyright (C) 2018-2019 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 #include <config.h>
9 
10 #include <boost/scoped_ptr.hpp>
11 
12 namespace isc {
13 namespace dhcp {
14 
15 boost::scoped_ptr<ConfigBackendDHCPv4Mgr>&
16 ConfigBackendDHCPv4Mgr::getConfigBackendDHCPv4MgrPtr() {
17  static boost::scoped_ptr<ConfigBackendDHCPv4Mgr> cb_dhcp4_mgr;
18  return (cb_dhcp4_mgr);
19 }
20 
21 void
23  getConfigBackendDHCPv4MgrPtr().reset(new ConfigBackendDHCPv4Mgr());
24 }
25 
26 void
28  getConfigBackendDHCPv4MgrPtr().reset();
29 }
30 
33  boost::scoped_ptr<ConfigBackendDHCPv4Mgr>& cb_dhcp4_mgr = getConfigBackendDHCPv4MgrPtr();
34  if (!cb_dhcp4_mgr) {
35  create();
36  }
37  return (*cb_dhcp4_mgr);
38 }
39 
40 } // end of isc::dhcp namespace
41 } // end of isc namespace
static ConfigBackendDHCPv4Mgr & instance()
Returns a sole instance of the ConfigBackendDHCPv4Mgr.
Configuration Backend Manager for DHPCv4 servers.
Defines the logger used by the top-level component of kea-dhcp-ddns.
static void create()
Creates new instance of the ConfigBackendDHCPv4Mgr.
static void destroy()
Destroys the instance of the ConfigBackendDHCPv4Mgr.