28 boost::shared_ptr<CalloutManager>
32 if (!callout_manager_) {
34 "attempting to retrieve a CalloutManager for them");
37 return (callout_manager_);
41 : library_info_(libraries) {
44 for (HookLibsCollection::const_iterator it = libraries.begin();
45 it != libraries.end(); ++it) {
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()) {
94 lib_managers_.push_back(manager);
111 while (!lib_managers_.empty()) {
112 lib_managers_.pop_back();
117 callout_manager_.reset();
125 for (
auto lm = lib_managers_.rbegin(); lm != lib_managers_.rend(); ++lm) {
126 result = (*lm)->prepareUnloadLibrary() && result;
134 return (lib_managers_.size());
138 std::vector<std::string>
140 const std::vector<std::string>& libraries) {
142 std::vector<std::string> failures;
143 for (
size_t i = 0; i < libraries.size(); ++i) {
145 failures.push_back(libraries[i]);
bool prepareUnloadLibraries()
Prepare libaries unloading.
LoadLibraries not called.
void unloadLibraries()
Unload libraries.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries)
Validate libraries.
boost::shared_ptr< CalloutManager > getCalloutManager() const
Get callout manager.
static bool validateLibrary(const std::string &name)
Validate library.
int getLoadedLibraryCount() const
Get number of loaded libraries.
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
bool loadLibraries()
Load libraries.
Defines the logger used by the top-level component of kea-dhcp-ddns.
LibraryManagerCollection(const HookLibsCollection &libraries)
Constructor.