fawkes::BlackBoardNotifier Class Reference

BlackBoard notifier. More...

#include <blackboard/internal/notifier.h>

List of all members.

Public Member Functions

 BlackBoardNotifier ()
 Constructor.
virtual ~BlackBoardNotifier ()
 Destructor.
void register_listener (BlackBoardInterfaceListener *listener, unsigned int flags)
 Register BB event listener.
void unregister_listener (BlackBoardInterfaceListener *listener)
 Unregister BB interface listener.
void register_observer (BlackBoardInterfaceObserver *observer, unsigned int flags)
 Register BB interface observer.
void unregister_observer (BlackBoardInterfaceObserver *observer)
 Unregister BB interface observer.
void notify_of_data_change (const Interface *interface)
 Notify of data change.
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.
void notify_of_interface_created (const char *type, const char *id) throw ()
 Notify that an interface has been created.
void notify_of_interface_destroyed (const char *type, const char *id) throw ()
 Notify that an interface has been destroyed.
void notify_of_writer_added (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that writer has been added.
void notify_of_writer_removed (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that writer has been removed.
void notify_of_reader_added (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that reader has been added.
void notify_of_reader_removed (const Interface *interface, unsigned int event_instance_serial) throw ()
 Notify that reader has been removed.

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

fawkes::BlackBoardNotifier::BlackBoardNotifier (  ) 

Constructor.

Definition at line 55 of file notifier.cpp.

fawkes::BlackBoardNotifier::~BlackBoardNotifier (  )  [virtual]

Destructor.

Definition at line 80 of file notifier.cpp.


Member Function Documentation

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:
interface interface whose subscribers to notify
See also:
Interface::write()
BlackBoardInterfaceListener::bb_interface_data_changed()

Definition at line 706 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(), fawkes::Mutex::unlock(), fawkes::WaitCondition::wait(), and fawkes::WaitCondition::wake_all().

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

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

Notify that an interface has been created.

Parameters:
type type of the interface
id ID of the interface

Definition at line 394 of file notifier.cpp.

References fawkes::BlackBoardInterfaceObserver::bb_interface_created().

Referenced by fawkes::BlackBoardInterfaceManager::open_for_reading(), and fawkes::BlackBoardInterfaceManager::open_for_writing().

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

Notify that an interface has been destroyed.

Parameters:
type type of the interface
id ID of the interface

Definition at line 427 of file notifier.cpp.

References fawkes::BlackBoardInterfaceObserver::bb_interface_destroyed().

Referenced by fawkes::BlackBoardInterfaceManager::close().

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:
interface interface whose subscribers to notify
message message which is being received
Returns:
true if any of the listeners did return true, false if none returned true at all.
See also:
BlackBoardInterfaceListener::bb_interface_message_received()

Definition at line 768 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(), fawkes::Mutex::unlock(), fawkes::WaitCondition::wait(), and fawkes::WaitCondition::wake_all().

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

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

Notify that reader has been removed.

Parameters:
interface interface for which the reader has been removed
event_instance_serial instance serial of the interface that caused the event
See also:
BlackBoardInterfaceListener::bb_interface_reader_removed()

Definition at line 636 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_reader_removed(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::BlackBoardInterfaceListener::bbil_reader_interface(), fawkes::LibLogger::log_warn(), and fawkes::Interface::serial().

Referenced by fawkes::BlackBoardInterfaceManager::close(), and fawkes::BlackBoardInterfaceProxy::reader_removed().

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

Notify that writer has been added.

Parameters:
interface the 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_serial the instance serial of the interface that caused the event
See also:
BlackBoardInterfaceListener::bb_interface_writer_added()

Definition at line 487 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_writer_added(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::BlackBoardInterfaceListener::bbil_writer_interface(), and fawkes::LibLogger::log_warn().

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

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

Notify that writer has been removed.

Parameters:
interface interface for which the writer has been removed
event_instance_serial instance serial of the interface that caused the event
See also:
BlackBoardInterfaceListener::bb_interface_writer_removed()

Definition at line 529 of file notifier.cpp.

References fawkes::BlackBoardInterfaceListener::bb_interface_writer_removed(), fawkes::BlackBoardInterfaceListener::bbil_name(), fawkes::BlackBoardInterfaceListener::bbil_writer_interface(), fawkes::LibLogger::log_warn(), and fawkes::Interface::serial().

Referenced by fawkes::BlackBoardInterfaceManager::close(), and fawkes::BlackBoardInterfaceProxy::writer_removed().

void fawkes::BlackBoardNotifier::register_listener ( BlackBoardInterfaceListener listener,
unsigned int  flags 
)
void fawkes::BlackBoardNotifier::register_observer ( BlackBoardInterfaceObserver observer,
unsigned int  flags 
)
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:
listener BlackBoard event listener to remove

Definition at line 172 of file notifier.cpp.

Referenced by fawkes::RemoteBlackBoard::unregister_listener(), and fawkes::LocalBlackBoard::unregister_listener().

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:
observer BlackBoard event listener to remove

Definition at line 367 of file notifier.cpp.

Referenced by fawkes::RemoteBlackBoard::unregister_observer(), and fawkes::LocalBlackBoard::unregister_observer().


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

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1