Kea 3.0.0
libinfo.cc
Go to the documentation of this file.
1// Copyright (C) 2016-2024 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>
8
9#include <hooks/libinfo.h>
10
11namespace isc {
12namespace hooks {
13
14HookLibInfo::HookLibInfo(const std::string& libname,
16 const std::string& cfgname /* = "" */)
17 : libname_(libname), parameters_(parameters),
18 cfgname_ (cfgname.empty() ? libname : cfgname) {
19}
20
25std::vector<std::string>
27 std::vector<std::string> names;
28
29 for (auto const& it : libraries) {
30 names.push_back(it.libname_);
31 }
32 return (names);
33}
34
35bool
37 return ((libname_ == other.libname_) &&
38 (cfgname_ == other.cfgname_) &&
39 ((!parameters_ && !other.parameters_) ||
40 (parameters_ && other.parameters_ &&
41 parameters_->equals(*(other.parameters_)))));
42}
43
44};
45};
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
std::vector< std::string > extractNames(const isc::hooks::HookLibsCollection &libraries)
Extracts names from HookLibsCollection.
Definition libinfo.cc:26
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.
std::string cfgname_
Configured library name (e.g. rom 'library')
Definition libinfo.h:35
std::string libname_
Full file path of the library.
Definition libinfo.h:29
bool operator==(const HookLibInfo &other) const
Compare two HookLibInfos for equality.
Definition libinfo.cc:36
data::ConstElementPtr parameters_
Set of configured parameters (if any)
Definition libinfo.h:32
HookLibInfo(const std::string &libname, isc::data::ConstElementPtr parameters, const std::string &cfgname="")
Definition libinfo.cc:14