Kea 2.2.0
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>
13
14#include <boost/scoped_ptr.hpp>
15
16#include <string>
17
18namespace isc {
19namespace dhcp {
20
21
26class NoLeaseManager : public Exception {
27public:
28 NoLeaseManager(const char* file, size_t line, const char* what) :
29 isc::Exception(file, line, what) {}
30};
31
45public:
70 static void create(const std::string& dbaccess);
71
77 static void destroy();
78
86 static LeaseMgr& instance();
87
91 static bool haveInstance();
92
93private:
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
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Lease Manager Factory.
static void create(const std::string &dbaccess)
Create an instance of a lease manager.
static void destroy()
Destroy lease manager.
static LeaseMgr & instance()
Return current lease manager.
static bool haveInstance()
Indicates if the lease manager has been instantiated.
Abstract Lease Manager.
Definition: lease_mgr.h:223
No lease manager exception.
NoLeaseManager(const char *file, size_t line, const char *what)
An abstract API for lease database.
Defines the logger used by the top-level component of kea-lfc.