Fawkes API  Fawkes Development Version
fawkes::BlackBoardInstanceFactory Class Reference

BlackBoard instance factory. More...

#include <>>

Public Member Functions

 BlackBoardInstanceFactory ()
 Constructor. More...
 
 ~BlackBoardInstanceFactory ()
 Destructor. More...
 
Interfacenew_interface_instance (const char *type, const char *identifier)
 Creates a new interface instance. More...
 
void delete_interface_instance (Interface *interface)
 Destroy an interface instance. More...
 

Detailed Description

BlackBoard instance factory.

This class is used to interact with the interface shared object to create and delete interface instances.

Author
Tim Niemueller

Definition at line 36 of file instance_factory.h.

Constructor & Destructor Documentation

◆ BlackBoardInstanceFactory()

fawkes::BlackBoardInstanceFactory::BlackBoardInstanceFactory ( )

Constructor.

Definition at line 47 of file instance_factory.cpp.

◆ ~BlackBoardInstanceFactory()

fawkes::BlackBoardInstanceFactory::~BlackBoardInstanceFactory ( )

Destructor.

Definition at line 54 of file instance_factory.cpp.

Member Function Documentation

◆ delete_interface_instance()

void fawkes::BlackBoardInstanceFactory::delete_interface_instance ( Interface interface)

Destroy an interface instance.

The destroyer function for the given interface is called to destroy the given interface instance.

Parameters
interfaceto destroy
Exceptions
BlackBoardInterfaceNotFoundExceptionthrown if the destroyer function for the given interface could not be found. The interface will not be freed.

Definition at line 117 of file instance_factory.cpp.

References fawkes::ModuleManager::close_module(), fawkes::ModuleManager::get_module(), fawkes::ModuleManager::get_module_file_extension(), fawkes::Module::get_symbol(), fawkes::Module::has_symbol(), and fawkes::Module::unref().

Referenced by fawkes::RemoteBlackBoard::close(), fawkes::RemoteBlackBoard::try_aliveness_restore(), and fawkes::BlackBoardInterfaceManager::~BlackBoardInterfaceManager().

◆ new_interface_instance()

Interface * fawkes::BlackBoardInstanceFactory::new_interface_instance ( const char *  type,
const char *  identifier 
)

Creates a new interface instance.

This method will look in the for the appropriate library in LIBDIR/interfaces and then use the factory function for the interface of the given type. If this was found a new instance of the interface is returned.

Parameters
typetype of the interface
identifieridentifier of the interface
Returns
a new instance of the requested interface type
Exceptions
BlackBoardInterfaceNotFoundExceptionthrown if the factory function for the given interface type could not be found

Definition at line 71 of file instance_factory.cpp.

References fawkes::ModuleManager::get_module_file_extension(), fawkes::Module::get_symbol(), fawkes::Module::has_symbol(), and fawkes::ModuleManager::open_module().

Referenced by fawkes::RemoteBlackBoard::try_aliveness_restore(), and fawkes::BlackBoardInterfaceManager::~BlackBoardInterfaceManager().


The documentation for this class was generated from the following files: