Fawkes API  Fawkes Development Version
fawkes::BlackBoardNotifier Class Reference

BlackBoard notifier. More...

#include <>>

Public Member Functions

 BlackBoardNotifier ()
 Constructor. More...
 
virtual ~BlackBoardNotifier ()
 Destructor. More...
 
void register_listener (BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
 Register BB event listener. More...
 
void update_listener (BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
 Update BB event listener. More...
 
void unregister_listener (BlackBoardInterfaceListener *listener)
 Unregister BB interface listener. More...
 
void register_observer (BlackBoardInterfaceObserver *observer)
 Register BB interface observer. More...
 
void unregister_observer (BlackBoardInterfaceObserver *observer)
 Unregister BB interface observer. More...
 
void notify_of_data_change (const Interface *interface)
 Notify of data change. More...
 
bool notify_of_message_received (const Interface *interface, Message *message)
 Notify of message received Notify all subscribers of the given interface of an incoming message This also influences logging and sending data over the network so it is mandatory to call this function! The interface base class write method does that for you. More...
 
void notify_of_interface_created (const char *type, const char *id) throw ()
 Notify that an interface has been created. More...
 
void notify_of_interface_destroyed (const char *type, const char *id) throw ()
 Notify that an interface has been destroyed. More...
 
void notify_of_writer_added (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that writer has been added. More...
 
void notify_of_writer_removed (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that writer has been removed. More...
 
void notify_of_reader_added (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that reader has been added. More...
 
void notify_of_reader_removed (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that reader has been removed. More...
 

Detailed Description

BlackBoard notifier.

This class is used by the BlackBoard to notify listeners and observers of changes.

Author
Tim Niemueller

Definition at line 43 of file notifier.h.

Constructor & Destructor Documentation

◆ BlackBoardNotifier()

fawkes::BlackBoardNotifier::BlackBoardNotifier ( )

Constructor.

Definition at line 54 of file notifier.cpp.

◆ ~BlackBoardNotifier()

fawkes::BlackBoardNotifier::~BlackBoardNotifier ( )
virtual

Destructor.

Definition at line 74 of file notifier.cpp.

Member Function Documentation

◆ notify_of_data_change()

void fawkes::BlackBoardNotifier::notify_of_data_change ( const Interface interface)

Notify of data change.

Notify all subscribers of the given interface of a data change. This also influences logging and sending data over the network so it is mandatory to call this function! The interface base class write method does that for you.

Parameters
interfaceinterface whose subscribers to notify
See also
Interface::write()
BlackBoardInterfaceListener::bb_interface_data_changed()

Definition at line 660 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_data_changed(), fawkes::BlackBoardInterfaceListener::bbil_data_interface(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::Mutex::lock(), fawkes::LibLogger::log_warn(), fawkes::Interface::uid(), and fawkes::Mutex::unlock().

Referenced by fawkes::BlackBoardInterfaceManager::notify_of_data_change(), and fawkes::BlackBoardInterfaceProxy::process_data_changed().

◆ notify_of_interface_created()

void fawkes::BlackBoardNotifier::notify_of_interface_created ( const char *  type,
const char *  id 
)
throw (
)

◆ notify_of_interface_destroyed()

void fawkes::BlackBoardNotifier::notify_of_interface_destroyed ( const char *  type,
const char *  id 
)
throw (
)

Notify that an interface has been destroyed.

Parameters
typetype of the interface
idID of the interface

Definition at line 403 of file notifier.cpp.

References fawkes::BlackBoardInterfaceObserver::bb_interface_destroyed(), fawkes::Mutex::lock(), and fawkes::Mutex::unlock().

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

◆ notify_of_message_received()

bool fawkes::BlackBoardNotifier::notify_of_message_received ( const Interface interface,
Message message 
)

Notify of message received Notify all subscribers of the given interface of an incoming message This also influences logging and sending data over the network so it is mandatory to call this function! The interface base class write method does that for you.

Parameters
interfaceinterface whose subscribers to notify
messagemessage which is being received
Returns
false if any listener returned false, true otherwise
See also
BlackBoardInterfaceListener::bb_interface_message_received()

Definition at line 714 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_message_received(), fawkes::BlackBoardInterfaceListener::bbil_message_interface(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::Mutex::lock(), fawkes::LibLogger::log_warn(), fawkes::Interface::uid(), and fawkes::Mutex::unlock().

Referenced by fawkes::BlackBoardInterfaceProxy::process_interface_message(), and fawkes::BlackBoardMessageManager::transmit().

◆ notify_of_reader_added()

void fawkes::BlackBoardNotifier::notify_of_reader_added ( const Interface interface,
unsigned int  event_instance_serial 
)
throw (
)

◆ notify_of_reader_removed()

void fawkes::BlackBoardNotifier::notify_of_reader_removed ( const Interface interface,
unsigned int  event_instance_serial 
)
throw (
)

◆ notify_of_writer_added()

void fawkes::BlackBoardNotifier::notify_of_writer_added ( const Interface interface,
unsigned int  event_instance_serial 
)
throw (
)

Notify that writer has been added.

Parameters
interfacethe interface for which the event happened. It is not necessarily the instance which caused the event, but it must have the same mem serial.
event_instance_serialthe instance serial of the interface that caused the event
See also
BlackBoardInterfaceListener::bb_interface_writer_added()

Definition at line 463 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_writer_added(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::BlackBoardInterfaceListener::bbil_writer_interface(), fawkes::Mutex::lock(), fawkes::LibLogger::log_warn(), fawkes::Interface::uid(), and fawkes::Mutex::unlock().

Referenced by fawkes::BlackBoardInterfaceManager::open_for_writing(), and fawkes::BlackBoardInterfaceProxy::writer_added().

◆ notify_of_writer_removed()

void fawkes::BlackBoardNotifier::notify_of_writer_removed ( const Interface interface,
unsigned int  event_instance_serial 
)
throw (
)

◆ register_listener()

void fawkes::BlackBoardNotifier::register_listener ( BlackBoardInterfaceListener listener,
BlackBoard::ListenerRegisterFlag  flag 
)

Register BB event listener.

Parameters
listenerBlackBoard event listener to register
flagconcatenation of flags denoting which queue entries should be processed

Definition at line 90 of file notifier.cpp.

References update_listener().

Referenced by fawkes::BlackBoard::register_listener().

◆ register_observer()

◆ unregister_listener()

void fawkes::BlackBoardNotifier::unregister_listener ( BlackBoardInterfaceListener listener)

Unregister BB interface listener.

This will remove the given BlackBoard interface listener from any event that it was previously registered for.

Parameters
listenerBlackBoard event listener to remove

Definition at line 180 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::InterfaceMaps::data, fawkes::BlackBoardInterfaceListener::InterfaceMaps::messages, fawkes::BlackBoardInterfaceListener::InterfaceMaps::reader, fawkes::Interface::uid(), and fawkes::BlackBoardInterfaceListener::InterfaceMaps::writer.

Referenced by fawkes::BlackBoard::unregister_listener().

◆ unregister_observer()

void fawkes::BlackBoardNotifier::unregister_observer ( BlackBoardInterfaceObserver observer)

Unregister BB interface observer.

This will remove the given BlackBoard event listener from any event that it was previously registered for.

Parameters
observerBlackBoard event listener to remove

Definition at line 341 of file notifier.cpp.

Referenced by fawkes::BlackBoard::unregister_observer().

◆ update_listener()


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