Kea  2.1.7-git
lease_mgr_factory.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2020 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 LEASE_MGR_FACTORY_H
8 #define LEASE_MGR_FACTORY_H
9 
11 #include <dhcpsrv/lease_mgr.h>
12 #include <exceptions/exceptions.h>
13 
14 #include <boost/scoped_ptr.hpp>
15 
16 #include <string>
17 
18 namespace isc {
19 namespace dhcp {
20 
21 
26 class NoLeaseManager : public Exception {
27 public:
28  NoLeaseManager(const char* file, size_t line, const char* what) :
29  isc::Exception(file, line, what) {}
30 };
31 
45 public:
70  static void create(const std::string& dbaccess);
71 
77  static void destroy();
78 
86  static LeaseMgr& instance();
87 
91  static bool haveInstance();
92 
93 private:
99  static boost::scoped_ptr<LeaseMgr>& getLeaseMgrPtr();
100 
101 };
102 
103 } // end of isc::dhcp namespace
104 } // end of isc namespace
105 
106 #endif // LEASE_MGR_FACTORY_H
Abstract Lease Manager.
Definition: lease_mgr.h:223
Lease Manager Factory.
An abstract API for lease database.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-lfc.
No lease manager exception.
NoLeaseManager(const char *file, size_t line, const char *what)