eckit::system::LibraryManager class

Public static functions

static void enregister(const std::string& name, Library* obj)
Register a library.
static auto list() -> std::vector<std::string>
List currently loaded libraries.
static auto loadedPlugins() -> std::vector<std::string>
List currently loaded plugin libraries.
static void list(std::ostream& s)
Print the list of currently loaded libraries to a std::ostream.
static auto exists(const std::string& name) -> bool
Check if the process is linked to this library.
static auto lookup(const std::string& name) -> const Library&
Lookup a library reference in the manager.
static auto lookupPlugin(const std::string& name) -> const Plugin&
Lookup a Plugin reference in the manager.
static auto loadLibrary(const std::string& libname) -> void*
Loads a shared library.
static auto loadPlugin(const std::string& name, const std::string& library = std::string()) -> Plugin&
Loads a Plugin library.
static void autoLoadPlugins(const std::vector<std::string>& plugins)
Scans and Auto loads Plugins.
static void enregisterPlugin(const std::string& name, const std::string& libname)
Registers a library as a plugin To be called from the Plugin constructor.
static void deregisterPlugin(const std::string& name)
Deregisters a library as a plugin To be called from the Plugin destructor.
static void addPluginSearchPath(const std::string& path)
Adds plugin search paths.

Function documentation

static void eckit::system::LibraryManager::list(std::ostream& s)

Print the list of currently loaded libraries to a std::ostream.

Parameters
in Write list to this stream

static bool eckit::system::LibraryManager::exists(const std::string& name)

Check if the process is linked to this library.

Parameters
name in Library name
Returns true if library is registered as linked

static const Library& eckit::system::LibraryManager::lookup(const std::string& name)

Lookup a library reference in the manager.

Parameters
name in Library name

static const Plugin& eckit::system::LibraryManager::lookupPlugin(const std::string& name)

Lookup a Plugin reference in the manager.

Parameters
name in Plugin name

static void* eckit::system::LibraryManager::loadLibrary(const std::string& libname)

Loads a shared library.

Returns handle to the loaded library, to pass to dlclose

static Plugin& eckit::system::LibraryManager::loadPlugin(const std::string& name, const std::string& library = std::string())

Loads a Plugin library.

Parameters
name in Name of the Plugin to load.
library in containing the Plugin to load. Name does not contain prefix 'lib' nor system dependent extension (eg. .so or .dylib) If not passed, then assumed to equal to the name
Returns Plugin object loaded

static void eckit::system::LibraryManager::enregisterPlugin(const std::string& name, const std::string& libname)

Registers a library as a plugin To be called from the Plugin constructor.

Parameters
name in Name of the library plugin to register
libname

static void eckit::system::LibraryManager::deregisterPlugin(const std::string& name)

Deregisters a library as a plugin To be called from the Plugin destructor.

Parameters
name in Name of the library plugin to deregister