Kea 3.1.1
hooks_config.h
Go to the documentation of this file.
1// Copyright (C) 2017-2025 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 HOOKS_CONFIG_H
8#define HOOKS_CONFIG_H
9
11#include <cc/data.h>
12#include <cc/cfg_to_element.h>
13#include <hooks/libinfo.h>
14
15namespace isc {
16namespace hooks {
17
20 public:
21 InvalidHooksLibraries(const char* file, size_t line, const char* what) :
22 isc::Exception(file, line, what) { }
23};
24
37public:
40 HooksConfig() : libraries_() { }
41
48 void add(const std::string& libname,
50 const std::string& cfgname = "");
51
57 return libraries_;
58 }
59
61 void clear() {
62 libraries_.clear();
63 }
64
68 bool equal(const HooksConfig& other) const;
69
82 bool multi_threading_enabled) const;
83
96 void loadLibraries(bool multi_threading_enabled) const;
97
108
109private:
112};
113
114} // namespace hooks
115} // namespace isc
116
117#endif // HOOKS_CONFIG_H
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Wrapper class that holds hooks libraries configuration.
void clear()
Removes all configured hooks libraries.
bool equal(const HooksConfig &other) const
Compares two Hooks Config classes for equality.
void add(const std::string &libname, isc::data::ConstElementPtr parameters, const std::string &cfgname="")
Adds additional hooks libraries.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
void verifyLibraries(const isc::data::Element::Position &position, bool multi_threading_enabled) const
Verifies that libraries stored in libraries_ are valid.
isc::data::ElementPtr toElement() const
Unparse a configuration object.
HooksConfig()
Default constructor.
void loadLibraries(bool multi_threading_enabled) const
Commits hooks libraries configuration.
InvalidHooksLibraries(const char *file, size_t line, const char *what)
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
Definition libinfo.h:51
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.
Represents the position of the data element within a configuration string.
Definition data.h:94