24 #include <blackboard/internal/instance_factory.h> 25 #include <blackboard/exceptions.h> 27 #include <interface/interface.h> 29 #include <utils/system/dynamic_module/module_manager.h> 30 #include <utils/system/dynamic_module/module.h> 73 if (strlen(identifier) == 0) {
74 throw Exception(
"Interface ID may not be empty");
76 if (strlen(type) == 0) {
77 throw Exception(
"Interface type may not be empty");
79 if (strlen(type) > __INTERFACE_TYPE_SIZE) {
80 throw Exception(
"Interface type '%s' too long, maximum length is %zu",
81 type, __INTERFACE_TYPE_SIZE);
83 if (strlen(identifier) > __INTERFACE_ID_SIZE) {
84 throw Exception(
"Interface ID '%s' too long, maximum length is %zu",
85 type, __INTERFACE_ID_SIZE);
96 if ( ! mod->
has_symbol(
"interface_factory") ) {
103 iface->set_type_id(type, identifier);
126 if ( ! mod->
has_symbol(
"interface_destroy") ) {
virtual void unref()
Decrease the reference count of this module.
Interface * new_interface_instance(const char *type, const char *identifier)
Creates a new interface instance.
virtual void close_module(Module *module)
Close a module by Module instance.
Fawkes library namespace.
Base class for all Fawkes BlackBoard interfaces.
Dynamic module loader for Linux, FreeBSD, and MacOS X.
Base class for exceptions in Fawkes.
void delete_interface_instance(Interface *interface)
Destroy an interface instance.
void(* InterfaceDestroyFunc)(Interface *interface)
Interface destructor function for the shared library.
virtual const char * get_module_file_extension()
Get the file extension for the current module type.
~BlackBoardInstanceFactory()
Destructor.
Thrown if no definition of interface or interface generator found.
virtual Module * open_module(const char *filename)
Open a module.
virtual void * get_symbol(const char *symbol_name)
Get a symbol from the module.
BlackBoardInstanceFactory()
Constructor.
Interface *(* InterfaceFactoryFunc)(void)
Interface generator function for the shared library Do not use directly.
virtual Module * get_module(const char *filename)
Get a module if opened.
virtual bool has_symbol(const char *symbol_name)
Check if the module has the given symbol.