Fawkes API
Fawkes Development Version
|
25 #ifndef _UTILS_SYSTEM_DYNAMIC_MODULE_MODULE_H_
26 #define _UTILS_SYSTEM_DYNAMIC_MODULE_MODULE_H_
28 #include <core/exception.h>
101 virtual bool close();
103 virtual void unref();
106 virtual bool has_symbol(
const char *symbol_name);
107 virtual void *
get_symbol(
const char *symbol_name);
115 static const char *FILE_EXTENSION;
118 std::string filename_;
121 unsigned int ref_count_;
ModuleOpenException(const char *msg)
Constructor.
@ MODULE_FLAGS_NONE
No flags.
ModuleFlags
Flags for the loading process.
virtual bool notref()
Check if there are no reference to this module.
@ MODULE_BIND_MASK
Can be used to encode flags in a longer data field.
@ MODULE_BIND_LAZY
Perform lazy binding.
virtual std::string get_base_filename()
Get the base file name of the module.
@ MODULE_BIND_LOCAL
Symbols defined in this library are not made available to resolve references in subsequently loaded l...
virtual std::string get_filename()
Get the full file name of the module.
virtual bool operator==(const Module &cmod)
Compare to another Module instance.
virtual void unref()
Decrease the reference count of this module.
virtual void * get_symbol(const char *symbol_name)
Get a symbol from the module.
virtual bool close()
Close the module.
Module(std::string filename, ModuleFlags flags=MODULE_FLAGS_DEFAULT)
Constructor.
@ MODULE_BIND_GLOBAL
Symbols defined in this library are not made available to resolve references in subsequently loaded l...
virtual bool has_symbol(const char *symbol_name)
Check if the module has the given symbol.
Fawkes library namespace.
static const char * get_file_extension()
Get file extension for dl modules.
@ MODULE_NODELETE
Do not unload the library during dlclose().
virtual void open()
Open the module.
@ MODULE_BIND_NOW
Resolve all symbols immediately when loading the library.
virtual void ref()
Increment the reference count of this module.
@ MODULE_FLAGS_DEFAULT
Default flags, these are MODULE_BIND_GLOBAL, MODULE_BIND_NOW and MODULE_BIND_DEEP.
BlackBoard::ListenerRegisterFlag operator|(const BlackBoard::ListenerRegisterFlag &a, const BlackBoard::ListenerRegisterFlag &b)
Concatenation of register flags.
virtual unsigned int get_ref_count()
Get the reference count of this module.
@ MODULE_BIND_DEEP
Place the lookup scope of the symbols in this library ahead of the global scope.
virtual ~Module()
Destructor.
Dynamic module loader for Linux, FreeBSD, and MacOS X.
Base class for exceptions in Fawkes.