13#include <boost/range/adaptor/reversed.hpp>
29boost::shared_ptr<CalloutManager>
33 if (!callout_manager_) {
35 "attempting to retrieve a CalloutManager for them");
38 return (callout_manager_);
42 : library_info_(libraries) {
45 for (
auto const& it : libraries) {
46 library_names_.push_back(it.first);
56 if (!lib_managers_.empty()) {
80 for (
size_t i = 0; i < library_names_.size(); ++i) {
85 boost::shared_ptr<LibraryManager> manager(
93 if (manager->loadLibrary(multi_threading_enabled)) {
94 lib_managers_.push_back(manager);
111 while (!lib_managers_.empty()) {
112 lib_managers_.pop_back();
117 callout_manager_.reset();
125 for (
auto const& lm : boost::adaptors::reverse(lib_managers_)) {
126 result = lm->prepareUnloadLibrary() && result;
134 return (lib_managers_.size());
138std::vector<std::string>
140 bool multi_threading_enabled) {
142 std::vector<std::string> failures;
143 for (
size_t i = 0; i < libraries.size(); ++i) {
145 failures.push_back(libraries[i]);
void unloadLibraries()
Unload libraries.
LibraryManagerCollection(const HookLibsCollection &libraries)
Constructor.
boost::shared_ptr< CalloutManager > getCalloutManager() const
Get callout manager.
bool prepareUnloadLibraries()
Prepare libaries unloading.
int getLoadedLibraryCount() const
Get number of loaded libraries.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries, bool multi_threading_enabled=false)
Validate libraries.
bool loadLibraries(bool multi_threading_enabled=false)
Load libraries.
static bool validateLibrary(const std::string &name, bool multi_threading_enabled=false)
Validate library.
LoadLibraries not called.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
Defines the logger used by the top-level component of kea-lfc.