Fawkes API
Fawkes Development Version
|
opens and maintains multiple interfaces defined by a pattern More...
#include "interface_list_maintainer.h"
Public Member Functions | |
BlackBoardInterfaceListMaintainer (const char *n, BlackBoard *bb, Logger *l, const char *type, const char *pattern) | |
Constructor. More... | |
virtual | ~BlackBoardInterfaceListMaintainer () |
Destructor. More... | |
template<class InterfaceType > | |
std::list< InterfaceType * > | lock_and_get_list () |
Locks the mutex in this class and returns a list of all interfaces defined by the pattern. More... | |
void | unlock_list () |
unlocks the mutex in this class More... | |
![]() | |
BlackBoardInterfaceObserver () | |
Empty constructor. More... | |
virtual | ~BlackBoardInterfaceObserver () |
Destructor. More... | |
virtual void | bb_interface_destroyed (const char *type, const char *id) throw () |
BlackBoard interface destroyed notification. More... | |
![]() | |
BlackBoardInterfaceListener (const char *name_format,...) | |
Constructor. More... | |
virtual | ~BlackBoardInterfaceListener () |
Destructor. More... | |
const char * | bbil_name () const |
Get BBIL name. More... | |
virtual void | bb_interface_data_changed (Interface *interface) throw () |
BlackBoard data changed notification. More... | |
virtual bool | bb_interface_message_received (Interface *interface, Message *message) throw () |
BlackBoard message received notification. More... | |
virtual void | bb_interface_writer_added (Interface *interface, unsigned int instance_serial) throw () |
A writing instance has been opened for a watched interface. More... | |
virtual void | bb_interface_reader_added (Interface *interface, unsigned int instance_serial) throw () |
A reading instance has been opened for a watched interface. More... | |
Additional Inherited Members | |
![]() | |
enum | QueueEntryType { DATA = 0, MESSAGES = 1, READER = 2, WRITER = 3 } |
Queue entry type. More... | |
typedef std::list< QueueEntry > | InterfaceQueue |
Queue of additions/removal of interfaces. More... | |
typedef std::map< std::string, Interface * > | InterfaceMap |
Map of currently active event subscriptions. More... | |
![]() | |
typedef LockMap< std::string, std::list< std::string > > | ObservedInterfaceLockMap |
Type for lockable interface type hash sets. More... | |
typedef ObservedInterfaceLockMap::iterator | ObservedInterfaceLockMapIterator |
Type for iterator of lockable interface type hash sets. More... | |
![]() | |
void | bbio_add_observed_create (const char *type_pattern, const char *id_pattern="*") throw () |
Add interface creation type to watch list. More... | |
void | bbio_add_observed_destroy (const char *type_pattern, const char *id_pattern="*") throw () |
Add interface destruction type to watch list. More... | |
ObservedInterfaceLockMap * | bbio_get_observed_create () throw () |
Get interface creation type watch list. More... | |
ObservedInterfaceLockMap * | bbio_get_observed_destroy () throw () |
Get interface destriction type watch list. More... | |
![]() | |
void | bbil_add_data_interface (Interface *interface) |
Add an interface to the data modification watch list. More... | |
void | bbil_add_message_interface (Interface *interface) |
Add an interface to the message received watch list. More... | |
void | bbil_add_reader_interface (Interface *interface) |
Add an interface to the reader addition/removal watch list. More... | |
void | bbil_add_writer_interface (Interface *interface) |
Add an interface to the writer addition/removal watch list. More... | |
void | bbil_remove_data_interface (Interface *interface) |
Remove an interface to the data modification watch list. More... | |
void | bbil_remove_message_interface (Interface *interface) |
Remove an interface to the message received watch list. More... | |
void | bbil_remove_reader_interface (Interface *interface) |
Remove an interface to the reader addition/removal watch list. More... | |
void | bbil_remove_writer_interface (Interface *interface) |
Remove an interface to the writer addition/removal watch list. More... | |
Interface * | bbil_data_interface (const char *iuid) throw () |
Get interface instance for given UID. More... | |
Interface * | bbil_message_interface (const char *iuid) throw () |
Get interface instance for given UID. More... | |
Interface * | bbil_reader_interface (const char *iuid) throw () |
Get interface instance for given UID. More... | |
Interface * | bbil_writer_interface (const char *iuid) throw () |
Get interface instance for given UID. More... | |
opens and maintains multiple interfaces defined by a pattern
Definition at line 45 of file interface_list_maintainer.h.
BlackBoardInterfaceListMaintainer::BlackBoardInterfaceListMaintainer | ( | const char * | n, |
BlackBoard * | bb, | ||
Logger * | l, | ||
const char * | type, | ||
const char * | pattern | ||
) |
Constructor.
n | name of plugin to use this |
bb | pointer to the BlackBoard given by abstract |
l | pointer to the Logger given by abstract |
type | the interface type |
pattern | the pattern for interfaces to open |
Definition at line 46 of file interface_list_maintainer.cpp.
References fawkes::BlackBoardInterfaceListener::bbil_add_reader_interface(), fawkes::BlackBoardInterfaceListener::bbil_add_writer_interface(), fawkes::BlackBoardInterfaceObserver::bbio_add_observed_create(), fawkes::BlackBoard::close(), fawkes::LockList< Type >::mutex(), fawkes::BlackBoard::open_multiple_for_reading(), fawkes::BlackBoard::register_listener(), and fawkes::BlackBoard::register_observer().
|
virtual |
Destructor.
Definition at line 88 of file interface_list_maintainer.cpp.
References fawkes::BlackBoardInterfaceListener::bbil_add_reader_interface(), fawkes::BlackBoardInterfaceListener::bbil_add_writer_interface(), fawkes::BlackBoardInterfaceListener::bbil_remove_reader_interface(), fawkes::BlackBoardInterfaceListener::bbil_remove_writer_interface(), fawkes::BlackBoard::close(), fawkes::Interface::has_writer(), fawkes::Logger::log_error(), fawkes::Logger::log_info(), fawkes::Logger::log_warn(), fawkes::LockList< Type >::mutex(), fawkes::Interface::num_readers(), fawkes::BlackBoard::open_for_reading(), fawkes::LockList< Type >::push_back_locked(), fawkes::Interface::type(), fawkes::Interface::uid(), fawkes::LockList< Type >::unlock(), fawkes::BlackBoard::update_listener(), fawkes::Exception::what(), and fawkes::Exception::what_no_backtrace().
std::list< InterfaceType * > BlackBoardInterfaceListMaintainer::lock_and_get_list | ( | ) |
Locks the mutex in this class and returns a list of all interfaces defined by the pattern.
after the list is used unlock_list() needs to be called to unlock the mutex in this class
Definition at line 86 of file interface_list_maintainer.h.
References fawkes::LockList< Type >::lock().
void BlackBoardInterfaceListMaintainer::unlock_list | ( | ) |
unlocks the mutex in this class
this method needs to be called after lock_and_get_list() the list returned by lock_and_get_list() is invalid and shouldn't be used after this method is called
Definition at line 211 of file interface_list_maintainer.cpp.
References fawkes::LockList< Type >::unlock().