1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2020-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Kea Hooks Basic
// Commercial End User License Agreement v2.0. See COPYING file in the premium/
// directory.

#include <config.h>

#include <exceptions/exceptions.h>
#include <lease_query_impl_factory.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

using namespace isc;
using namespace isc::data;
using namespace isc::lease_query;

LeaseQueryImplPtr LeaseQueryImplFactory::impl_(0);

void
LeaseQueryImplFactory::createImpl(uint16_t family, ConstElementPtr config) {
    if (family == AF_INET) {
        impl_.reset(new LeaseQueryImpl4(config));
    } else {
        impl_.reset(new LeaseQueryImpl6(config));
    }
}

void
LeaseQueryImplFactory::destroyImpl() {
    impl_.reset();
}

const LeaseQueryImpl&
LeaseQueryImplFactory::getImpl() {
    if (!impl_) {
        isc_throw(Unexpected, "LeaseQueryImpl does not exist");
    }

    return (*impl_);
}