Fawkes API  Fawkes Development Version
fawkes::BlackBoard Class Referenceabstract

The BlackBoard abstract class. More...

#include <>>

Inheritance diagram for fawkes::BlackBoard:

Public Types

enum  ListenerRegisterFlag {
  BBIL_FLAG_DATA = 1, BBIL_FLAG_MESSAGES = 2, BBIL_FLAG_READER = 4, BBIL_FLAG_WRITER = 8,
  BBIL_FLAG_ALL = 15
}
 Flags to constrain listener registration/updates. More...
 

Public Member Functions

virtual ~BlackBoard ()
 Destructor. More...
 
virtual Interfaceopen_for_reading (const char *interface_type, const char *identifier, const char *owner=NULL)=0
 Open interface for reading. More...
 
virtual Interfaceopen_for_writing (const char *interface_type, const char *identifier, const char *owner=NULL)=0
 Open interface for writing. More...
 
virtual void close (Interface *interface)=0
 Close interface. More...
 
virtual Interfaceopen_for_reading_f (const char *interface_type, const char *identifier,...)
 Open interface for reading with identifier format string. More...
 
virtual Interfaceopen_for_writing_f (const char *interface_type, const char *identifier,...)
 Open interface for writing with identifier format string. More...
 
virtual InterfaceInfoListlist_all ()=0
 Get list of all currently existing interfaces. More...
 
virtual InterfaceInfoListlist (const char *type_pattern, const char *id_pattern)=0
 Get list of interfaces matching type and ID patterns. More...
 
virtual bool is_alive () const =0 throw ()
 Check if the BlackBoard is still alive. More...
 
virtual bool try_aliveness_restore ()=0 throw ()
 Try to restore the aliveness of the BlackBoard instance. More...
 
virtual std::list< Interface * > open_multiple_for_reading (const char *type_pattern, const char *id_pattern="*", const char *owner=NULL)=0
 Open multiple interfaces for reading. More...
 
template<class InterfaceType >
std::list< InterfaceType * > open_multiple_for_reading (const char *id_pattern="*", const char *owner=NULL)
 Open all interfaces of given type for reading. More...
 
template<class InterfaceType >
InterfaceType * open_for_reading (const char *identifier, const char *owner=NULL)
 Get interface of given type. More...
 
template<class InterfaceType >
InterfaceType * open_for_writing (const char *identifier, const char *owner=NULL)
 Get writer interface of given type. More...
 
template<class InterfaceType >
InterfaceType * open_for_reading_f (const char *identifier,...)
 Get interface of given type with identifier format string. More...
 
template<class InterfaceType >
InterfaceType * open_for_writing_f (const char *identifier,...)
 Get writer interface of given type with identifier format string. More...
 
virtual void register_listener (BlackBoardInterfaceListener *listener, ListenerRegisterFlag flag=BBIL_FLAG_ALL)
 Register BB event listener. More...
 
virtual void update_listener (BlackBoardInterfaceListener *listener, ListenerRegisterFlag flag=BBIL_FLAG_ALL)
 Update BB event listener. More...
 
virtual void unregister_listener (BlackBoardInterfaceListener *listener)
 Unregister BB interface listener. More...
 
virtual void register_observer (BlackBoardInterfaceObserver *observer)
 Register BB interface observer. More...
 
virtual void unregister_observer (BlackBoardInterfaceObserver *observer)
 Unregister BB interface observer. More...
 
std::string demangle_fawkes_interface_name (const char *type)
 Produce interface name from C++ signature. More...
 
std::string format_identifier (const char *identifier_format, va_list arg)
 Get formatted identifier string. More...
 

Protected Member Functions

 BlackBoard (bool create_notifier=true)
 Constructor. More...
 

Protected Attributes

BlackBoardNotifier__notifier
 Notifier for BB events. More...
 

Detailed Description

The BlackBoard abstract class.

This class is the single one entry point for programs that use the BlackBoard. It is used to open and close interfaces, register and unregister listeners and observers and to maintain the BlackBoard shared memory segment. Not other classes shall be used directly.

The BlackBoard holds a number of so-called interfaces. The interfaces store data and provide means to pass messages. The BlackBoard also allows for registering listeners and observers. The listeners can be used to get events for specific interfaces while the observer gets global interface creation and destruction events for a specified set of types of interfaces.

An interface consists of a few parts. First there is the storage block. This is a chunk of memory in the shared memory segment where the actual data is stored. Then there is the accessor object, an instance of a derivate of the Interface class which is used to access the data in the shared memory segment. Last but not least there is an internal message queue that can be used to pass messages from readers to the writer (not the other way around!).

The interface manager keeps track of all the allocated interfaces. Events can be triggered if a specific interface changes (like logging the data to a file, sending it over the network or notifying another interface of such a change).

Interfaces can only be instantiated through the BlackBoard. The BlackBoard instantiates an interface on request and guarantees that the instance is fully initialized and usable. This cannot be guaranteed if instantiating an interface through any other means!

Interfaces can be opened for reading or writing, not both! There can be only one writer at a time for any given interface. Interfaces are identified via a type (which denotes the data and its semantics) and an identifier. There may be several interfaces for a given type, but the identifier has to be unique. The identifier is in most cases a well-known string that is used to share data among plugins.

Interfaces provide a way to propagate data to the writer via messages. Available messages types depend on the interface type. Only matching messages are accepted and can be queued.

The BlackBoard can operate in two modes, master and slave. Only the master creates and destroys the shared memory segment. Currently, the slave mode is not fully implemented and thus may not be used.

See also
Interface
Message
Author
Tim Niemueller

Definition at line 48 of file blackboard.h.

Member Enumeration Documentation

◆ ListenerRegisterFlag

Flags to constrain listener registration/updates.

Enumerator
BBIL_FLAG_DATA 

consider data events

BBIL_FLAG_MESSAGES 

consider message received events

BBIL_FLAG_READER 

consider reader events

BBIL_FLAG_WRITER 

consider writer events

BBIL_FLAG_ALL 

consider all events

Definition at line 98 of file blackboard.h.

Constructor & Destructor Documentation

◆ ~BlackBoard()

fawkes::BlackBoard::~BlackBoard ( )
virtual

Destructor.

Definition at line 179 of file blackboard.cpp.

References __notifier.

◆ BlackBoard()

fawkes::BlackBoard::BlackBoard ( bool  create_notifier = true)
protected

Constructor.

Parameters
create_notifiertrue to create the notifier used for event notification, false not to create. Set to false only if you either forward notifier related calls or implement custom handling.

Definition at line 169 of file blackboard.cpp.

References __notifier.

Member Function Documentation

◆ close()

void fawkes::BlackBoard::close ( Interface interface)
pure virtual

Close interface.

Parameters
interfaceinterface to close

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by RosJointThread::bb_interface_created(), RosPosition3DThread::bb_interface_created(), MongoLogBlackboardThread::bb_interface_created(), LaserPointCloudThread::bb_interface_created(), RosLaserScanThread::bb_interface_created(), RosTfThread::bb_interface_created(), fawkes::tf::TransformListener::bb_interface_created(), RobotStatePublisherThread::bb_interface_created(), RosJointThread::bb_interface_reader_removed(), RosPosition3DThread::bb_interface_reader_removed(), LaserPointCloudThread::bb_interface_reader_removed(), RosLaserScanThread::bb_interface_reader_removed(), RosTfThread::bb_interface_reader_removed(), fawkes::tf::TransformListener::bb_interface_reader_removed(), RobotStatePublisherThread::bb_interface_reader_removed(), fawkes::BlackBoardInterfaceListMaintainer::BlackBoardInterfaceListMaintainer(), fawkes::BlackBoardNetworkHandler::client_disconnected(), BlackboardCLIPSFeature::clips_context_destroyed(), fawkes::BlackBoardWithOwnership::close(), fawkes::LuaInterfaceImporter::close_reading_interfaces(), fawkes::LuaInterfaceImporter::close_writing_interfaces(), fawkes::EclExternalBlackBoard::disconnect(), ExampleBlackBoardThread::finalize(), JacoActThread::finalize(), JacoBimanualActThread::finalize(), JoystickSensorThread::finalize(), BallPosLogThread::finalize(), AgentControlThread::finalize(), RoombaJoystickThread::finalize(), OpenRaveMessageHandlerThread::finalize(), ROSOdometryThread::finalize(), IMUSensorThread::finalize(), FestivalSynthThread::finalize(), RobotinoRosJointsThread::finalize(), ROSCmdVelThread::finalize(), PanTiltDirectedPerceptionThread::finalize(), JoystickTeleOpThread::finalize(), RosNavgraphBreakoutThread::finalize(), WebviewPtzCamThread::finalize(), LaserSensorThread::finalize(), FliteSynthThread::finalize(), PanTiltSonyEviD100PThread::finalize(), RosJointThread::finalize(), RobotinoIrPclThread::finalize(), RosPosition3DThread::finalize(), RosNavigatorThread::finalize(), MapLaserGenThread::finalize(), OpenNiHandTrackerThread::finalize(), LaserSimThread::finalize(), IMUAcquisitionThread::finalize(), PointCloudDBStoreThread::finalize(), RefBoxCommThread::finalize(), NaoQiSpeechSynthThread::finalize(), NavGraphGeneratorThread::finalize(), RobotinoSensorThread::finalize(), LocalizationSimThread::finalize(), VisLocalizationThread::finalize(), LaserPointCloudThread::finalize(), NaoQiLedThread::finalize(), NaoQiMotionThread::finalize(), LaserFilterThread::finalize(), PointCloudDBRetrieveThread::finalize(), ClipsAgentThread::finalize(), RosLaserScanThread::finalize(), RosMoveBaseThread::finalize(), ColliActThread::finalize(), BBLogReplayThread::finalize(), RosSkillerThread::finalize(), XabslEngineThread::finalize(), RobotinoActThread::finalize(), NaoQiButtonThread::finalize(), DynamixelDriverThread::finalize(), AmclROSThread::finalize(), OpenNiUserTrackerThread::finalize(), PanTiltRX28Thread::finalize(), PointCloudDBMergeThread::finalize(), NavGraphClustersThread::finalize(), PointCloudDBROSCommThread::finalize(), BBLoggerThread::finalize(), NaoQiDCMThread::finalize(), LaserClusterThread::finalize(), RosTfThread::finalize(), LuaAgentPeriodicExecutionThread::finalize(), RobotinoSimThread::finalize(), LuaAgentContinuousExecutionThread::finalize(), NavGraphThread::finalize(), PlayerClientThread::finalize(), ColliThread::finalize(), FvAcquisitionThread::finalize(), Bumblebee2Thread::finalize(), SkillerExecutionThread::finalize(), KatanaActThread::finalize(), NavGraphInteractiveThread::finalize(), LaserLinesThread::finalize(), AmclThread::finalize(), RobotStatePublisherThread::finalize(), TabletopObjectsThread::finalize(), OpenNiHandTrackerThread::hand_destroy(), BallPosLogThread::init(), RoombaJoystickThread::init(), WebviewPtzCamThread::init(), MongoLogBlackboardThread::init(), Roomba500Thread::init(), NaoQiLedThread::init(), ClipsAgentThread::init(), LaserFilterThread::init(), DynamixelDriverThread::init(), LaserClusterThread::init(), BBLoggerThread::init(), ColliThread::init(), SkillerExecutionThread::init(), LaserLinesThread::init(), RobotStatePublisherThread::init(), TabletopObjectsThread::init(), fawkes::EclExternalBlackBoard::interfaces(), BlackBoardSynchronizationThread::loop(), fawkes::BlackBoardNetworkHandler::loop(), NavGraphClustersThread::loop(), OpenNiUserTrackerThread::new_user(), LaserDeadSpotCalibrator::num_detected_spots(), fawkes::openni::SkelIfObserver::process_queue(), BatteryMonitorTreeView::rem_host(), LaserFilterThread::wait_done(), BlackboardCLIPSFeature::~BlackboardCLIPSFeature(), fawkes::BlackBoardInterfaceListMaintainer::~BlackBoardInterfaceListMaintainer(), fawkes::BlackBoardNetworkHandler::~BlackBoardNetworkHandler(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), fawkes::EclExternalBlackBoard::~EclExternalBlackBoard(), JoystickRemoteBlackBoardPoster::~JoystickRemoteBlackBoardPoster(), LuaAgentContinuousExecutionThread::~LuaAgentContinuousExecutionThread(), LuaAgentPeriodicExecutionThread::~LuaAgentPeriodicExecutionThread(), NaoGuiGtkWindow::~NaoGuiGtkWindow(), RemoteBlackBoardRefBoxProcessor::~RemoteBlackBoardRefBoxProcessor(), SkillGuiGtkWindow::~SkillGuiGtkWindow(), fawkes::tf::TransformListener::~TransformListener(), and fawkes::tf::TransformPublisher::~TransformPublisher().

◆ demangle_fawkes_interface_name()

std::string fawkes::BlackBoard::demangle_fawkes_interface_name ( const char *  type)

Produce interface name from C++ signature.

This extracts the interface name for a mangled signature. It has has been coded with GCC (4) in mind and assumes interfaces to be in the fawkes namespace. It cannot deal with anythin else.

Parameters
typetype name to strip
Returns
stripped class type, use delete to free it after you are done

Definition at line 260 of file blackboard.cpp.

Referenced by open_for_reading(), open_for_reading_f(), open_for_writing(), open_for_writing_f(), and open_multiple_for_reading().

◆ format_identifier()

std::string fawkes::BlackBoard::format_identifier ( const char *  identifier_format,
va_list  arg 
)

Get formatted identifier string.

Parameters
identifier_formatidentifier format string (sprintf syntax)
argarguments for format string
Returns
formatted string

Definition at line 276 of file blackboard.cpp.

Referenced by open_for_reading_f(), and open_for_writing_f().

◆ is_alive()

◆ list()

InterfaceInfoList * fawkes::BlackBoard::list ( const char *  type_pattern,
const char *  id_pattern 
)
pure virtual

Get list of interfaces matching type and ID patterns.

See the fnmatch() documentation for possible patterns.

Parameters
type_patternpattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface type.
id_patternpattern with shell like globs (* for any number of characters, ? for exactly one character) to match the interface ID.
Returns
list of interfaces

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by fawkes::InterfaceChooserDialog::init(), fawkes::BlackBoardWithOwnership::list(), and fawkes::BlackBoardNetworkHandler::loop().

◆ list_all()

InterfaceInfoList * fawkes::BlackBoard::list_all ( )
pure virtual

◆ open_for_reading() [1/2]

Interface * fawkes::BlackBoard::open_for_reading ( const char *  type,
const char *  identifier,
const char *  owner = NULL 
)
pure virtual

Open interface for reading.

This will create a new interface instance of the given type. The result can be casted to the appropriate type.

Parameters
typetype of the interface
identifieridentifier of the interface
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by BatteryMonitorTreeView::add_host(), fawkes::LuaInterfaceImporter::add_interface(), LaserPointCloudThread::bb_interface_created(), RosLaserScanThread::bb_interface_created(), RosTfThread::bb_interface_created(), fawkes::tf::TransformListener::bb_interface_created(), BlackboardCLIPSFeature::clips_context_destroyed(), ExampleBlackBoardThread::init(), BallPosLogThread::init(), AgentControlThread::init(), RoombaJoystickThread::init(), ROSCmdVelThread::init(), ROSOdometryThread::init(), RobotinoRosJointsThread::init(), JoystickTeleOpThread::init(), WebviewPtzCamThread::init(), RobotinoIrPclThread::init(), MapLaserGenThread::init(), RefBoxCommThread::init(), VisLocalizationThread::init(), NaoQiLedThread::init(), NaoQiMotionThread::init(), ClipsAgentThread::init(), RosMoveBaseThread::init(), RobotinoActThread::init(), NaoQiButtonThread::init(), RosSkillerThread::init(), AmclROSThread::init(), PointCloudDBROSCommThread::init(), XabslEngineThread::init(), BBLoggerThread::init(), LuaAgentPeriodicExecutionThread::init(), NavGraphThread::init(), LuaAgentContinuousExecutionThread::init(), SkillerExecutionThread::init(), NavGraphInteractiveThread::init(), AmclThread::init(), fawkes::EclExternalBlackBoard::interfaces(), BlackBoardSynchronizationThread::loop(), fawkes::BlackBoardNetworkHandler::loop(), NavGraphClustersThread::loop(), ColliThread::loop(), LaserDeadSpotCalibrator::num_detected_spots(), fawkes::BlackBoardWithOwnership::open_for_reading(), open_for_reading(), open_for_reading_f(), fawkes::openni::HandIfObserver::process_queue(), fawkes::openni::SkelIfObserver::process_queue(), fawkes::InterfaceChooserDialog::run_and_open_for_reading(), fawkes::openni::SkelIfObserver::SkelIfObserver(), LaserFilterThread::wait_done(), WebviewPtzCamRequestProcessor::WebviewPtzCamRequestProcessor(), fawkes::BlackBoardInterfaceListMaintainer::~BlackBoardInterfaceListMaintainer(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), fawkes::LuaInterfaceImporter::~LuaInterfaceImporter(), NaoGuiGtkWindow::~NaoGuiGtkWindow(), RemoteBlackBoardRefBoxProcessor::~RemoteBlackBoardRefBoxProcessor(), and SkillGuiGtkWindow::~SkillGuiGtkWindow().

◆ open_for_reading() [2/2]

template<class InterfaceType >
InterfaceType * fawkes::BlackBoard::open_for_reading ( const char *  identifier,
const char *  owner = NULL 
)

Get interface of given type.

This will open a new interface for reading just like the non-template version of open_for_reading(). But with the template method you will get a correctly typed object that you can use. An TypeMismatchException is thrown if the string representation of the type and the actual class type of the interface do not match.

Parameters
identifieridentifier of the interface
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
TypeMismatchExceptionthrown if type in interface_type and the actual class type do not fit.

Definition at line 143 of file blackboard.h.

References demangle_fawkes_interface_name(), and open_for_reading().

◆ open_for_reading_f() [1/2]

Interface * fawkes::BlackBoard::open_for_reading_f ( const char *  interface_type,
const char *  identifier,
  ... 
)
virtual

Open interface for reading with identifier format string.

This will create a new interface instance of the given type. The result can be casted to the appropriate type.

Parameters
interface_typetype of the interface
identifieridentifier format string of the interface
...arguments for identifier format
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.

Definition at line 299 of file blackboard.cpp.

References format_identifier(), and open_for_reading().

◆ open_for_reading_f() [2/2]

template<class InterfaceType >
InterfaceType * fawkes::BlackBoard::open_for_reading_f ( const char *  identifier,
  ... 
)

Get interface of given type with identifier format string.

This will open a new interface for reading just like the non-template version of open_for_reading(). But with the template method you will get a correctly typed object that you can use. An TypeMismatchException is thrown if the string representation of the type and the actual class type of the interface do not match.

Parameters
identifieridentifier of the interface
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
TypeMismatchExceptionthrown if type in interface_type and the actual class type do not fit.

Definition at line 167 of file blackboard.h.

References demangle_fawkes_interface_name(), format_identifier(), and open_for_reading().

◆ open_for_writing() [1/2]

Interface * fawkes::BlackBoard::open_for_writing ( const char *  type,
const char *  identifier,
const char *  owner = NULL 
)
pure virtual

Open interface for writing.

This will create a new interface instance of the given type. The result can be casted to the appropriate type. This will only succeed if there is not already a writer for the given interface type/id!

Parameters
typetype of the interface
identifieridentifier of the interface
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
BlackBoardWriterActiveExceptionthrown if there is already a writing instance with the same type/id

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by BlackboardCLIPSFeature::clips_context_destroyed(), OpenNiHandTrackerThread::hand_create(), ExampleBlackBoardThread::init(), JacoBimanualActThread::init(), JacoActThread::init(), JoystickSensorThread::init(), AgentControlThread::init(), OpenRaveMessageHandlerThread::init(), IMUSensorThread::init(), FestivalSynthThread::init(), PanTiltDirectedPerceptionThread::init(), RosNavgraphBreakoutThread::init(), LaserSensorThread::init(), PanTiltSonyEviD100PThread::init(), FliteSynthThread::init(), RosNavigatorThread::init(), MapLaserGenThread::init(), PointCloudDBStoreThread::init(), LaserSimThread::init(), IMUAcquisitionThread::init(), NaoQiSpeechSynthThread::init(), NavGraphGeneratorThread::init(), RefBoxCommThread::init(), Roomba500Thread::init(), RobotinoSensorThread::init(), LocalizationSimThread::init(), NaoQiMotionThread::init(), NaoQiLedThread::init(), PointCloudDBRetrieveThread::init(), ColliActThread::init(), RobotinoActThread::init(), BBLogReplayThread::init(), NaoQiButtonThread::init(), PointCloudDBMergeThread::init(), PanTiltRX28Thread::init(), NaoQiDCMThread::init(), BBLoggerThread::init(), LuaAgentPeriodicExecutionThread::init(), RobotinoSimThread::init(), NavGraphThread::init(), PlayerClientThread::init(), FvAcquisitionThread::init(), Bumblebee2Thread::init(), KatanaActThread::init(), LaserLinesThread::init(), AmclThread::init(), TabletopObjectsThread::init(), fawkes::EclExternalBlackBoard::interfaces(), JoystickRemoteBlackBoardPoster::JoystickRemoteBlackBoardPoster(), BlackBoardSynchronizationThread::loop(), fawkes::BlackBoardNetworkHandler::loop(), RosLaserScanThread::loop(), ColliThread::loop(), OpenNiUserTrackerThread::new_user(), LaserDeadSpotCalibrator::num_detected_spots(), fawkes::BlackBoardWithOwnership::open_for_writing(), open_for_writing(), open_for_writing_f(), fawkes::tf::TransformPublisher::TransformPublisher(), LaserFilterThread::wait_done(), and fawkes::LuaInterfaceImporter::~LuaInterfaceImporter().

◆ open_for_writing() [2/2]

template<class InterfaceType >
InterfaceType * fawkes::BlackBoard::open_for_writing ( const char *  identifier,
const char *  owner = NULL 
)

Get writer interface of given type.

This will open a new interface for writing just like the non-template version of open_for_writing(). But with the template method you will get a correctly typed object that you can use. An TypeMismatchException is thrown if the string representation of the type and the actual class type of the interface do not match.

Parameters
identifieridentifier of the interface
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
BlackBoardWriterActiveExceptionthrown if there is already a writing instance with the same type/id
TypeMismatchExceptionthrown if type in interface_type and the actual class type do not fit.

Definition at line 227 of file blackboard.h.

References demangle_fawkes_interface_name(), and open_for_writing().

◆ open_for_writing_f() [1/2]

Interface * fawkes::BlackBoard::open_for_writing_f ( const char *  interface_type,
const char *  identifier,
  ... 
)
virtual

Open interface for writing with identifier format string.

This will create a new interface instance of the given type. The result can be casted to the appropriate type. This will only succeed if there is not already a writer for the given interface type/id!

Parameters
interface_typetype of the interface
identifieridentifier format string of the interface
...arguments for identifier format
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
BlackBoardWriterActiveExceptionthrown if there is already a writing instance with the same type/id

Definition at line 326 of file blackboard.cpp.

References format_identifier(), and open_for_writing().

Referenced by DynamixelDriverThread::init(), and LaserClusterThread::init().

◆ open_for_writing_f() [2/2]

template<class InterfaceType >
InterfaceType * fawkes::BlackBoard::open_for_writing_f ( const char *  identifier,
  ... 
)

Get writer interface of given type with identifier format string.

This will open a new interface for writing just like the non-template version of open_for_writing(). But with the template method you will get a correctly typed object that you can use. An TypeMismatchException is thrown if the string representation of the type and the actual class type of the interface do not match.

Parameters
identifieridentifier of the interface
Returns
new fully initialized interface instance of requested type
Exceptions
OutOfMemoryExceptionthrown if there is not enough free space for the requested interface.
BlackBoardWriterActiveExceptionthrown if there is already a writing instance with the same type/id
TypeMismatchExceptionthrown if type in interface_type and the actual class type do not fit.

Definition at line 253 of file blackboard.h.

References demangle_fawkes_interface_name(), format_identifier(), and open_for_writing().

◆ open_multiple_for_reading() [1/2]

std::list< Interface * > fawkes::BlackBoard::open_multiple_for_reading ( const char *  type_pattern,
const char *  id_pattern = "*",
const char *  owner = NULL 
)
pure virtual

Open multiple interfaces for reading.

This will create interface instances for currently registered interfaces of the given type that match the given ID pattern. The result can be casted to the appropriate type.

Parameters
type_patternpattern of interface types to open, supports wildcards similar to filenames (*, ?, []), see "man fnmatch" for all supported.
id_patternpattern of interface IDs to open, supports wildcards similar to filenames (*, ?, []), see "man fnmatch" for all supported.
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
list of new fully initialized interface instances of requested type. You have to close all interfaces on your own when done with the list!

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by fawkes::BlackBoardInterfaceListMaintainer::BlackBoardInterfaceListMaintainer(), fawkes::openni::HandIfObserver::HandIfObserver(), RosJointThread::init(), MongoLogBlackboardThread::init(), RosPosition3DThread::init(), LaserPointCloudThread::init(), RosLaserScanThread::init(), NavGraphClustersThread::init(), RosTfThread::init(), RobotStatePublisherThread::init(), fawkes::BlackBoardWithOwnership::open_multiple_for_reading(), open_multiple_for_reading(), fawkes::openni::SkelIfObserver::SkelIfObserver(), fawkes::tf::TransformListener::TransformListener(), fawkes::LuaInterfaceImporter::~LuaInterfaceImporter(), and NaoGuiGtkWindow::~NaoGuiGtkWindow().

◆ open_multiple_for_reading() [2/2]

template<class InterfaceType >
std::list< InterfaceType * > fawkes::BlackBoard::open_multiple_for_reading ( const char *  id_pattern = "*",
const char *  owner = NULL 
)

Open all interfaces of given type for reading.

This will create interface instances for all currently registered interfaces of the given type. The result can be casted to the appropriate type.

Parameters
id_patternpattern of interface IDs to open, supports wildcards similar to filenames (*, ?, []), see "man fnmatch" for all supported.
ownername of entity which opened this interface. If using the BlackBoardAspect to access the blackboard leave this untouched unless you have a good reason.
Returns
list of new fully initialized interface instances of requested type. The is allocated using new and you have to free it using delete after you are done with it!

Definition at line 193 of file blackboard.h.

References demangle_fawkes_interface_name(), and open_multiple_for_reading().

◆ register_listener()

void fawkes::BlackBoard::register_listener ( BlackBoardInterfaceListener listener,
ListenerRegisterFlag  flag = BBIL_FLAG_ALL 
)
virtual

Register BB event listener.

Parameters
listenerBlackBoard event listener to register
flagflags what to register for

Reimplemented in fawkes::BlackBoardWithOwnership.

Definition at line 190 of file blackboard.cpp.

References __notifier, and fawkes::BlackBoardNotifier::register_listener().

Referenced by BatteryMonitorTreeView::add_host(), fawkes::BlackBoardInterfaceListMaintainer::BlackBoardInterfaceListMaintainer(), fawkes::BlackBoardNetHandlerInterfaceListener::BlackBoardNetHandlerInterfaceListener(), fawkes::BlackBoardOnMessageWaker::BlackBoardOnMessageWaker(), fawkes::BlackBoardOnUpdateWaker::BlackBoardOnUpdateWaker(), FestivalSynthThread::init(), PanTiltDirectedPerceptionThread::init(), PanTiltSonyEviD100PThread::init(), RosJointThread::init(), FliteSynthThread::init(), RosPosition3DThread::init(), NavGraphGeneratorThread::init(), LaserPointCloudThread::init(), NaoQiLedThread::init(), RosLaserScanThread::init(), PanTiltRX28Thread::init(), NavGraphClustersThread::init(), DynamixelDriverThread::init(), BBLoggerThread::init(), RosTfThread::init(), FvAcquisitionThread::init(), SkillerExecutionThread::init(), KatanaActThread::init(), AmclThread::init(), RobotStatePublisherThread::init(), BlackBoardSynchronizationThread::loop(), fawkes::BlackBoardWithOwnership::register_listener(), SyncInterfaceListener::SyncInterfaceListener(), fawkes::tf::TransformListener::TransformListener(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), NaoGuiGtkWindow::~NaoGuiGtkWindow(), and SkillGuiGtkWindow::~SkillGuiGtkWindow().

◆ register_observer()

◆ try_aliveness_restore()

bool fawkes::BlackBoard::try_aliveness_restore ( )
throw (
)
pure virtual

Try to restore the aliveness of the BlackBoard instance.

Note that even though the aliveness of the BlackBoard is restored single interfaces may still be invalid. That can for instance happen if a remote connection is re-established and a writer has been created during the downtime and an own writer instance of that very interface cannot be restored.

Returns
true if the aliveness could be restored and the BlackBoard is operational again, false otherwise.

Implemented in fawkes::RemoteBlackBoard, fawkes::LocalBlackBoard, and fawkes::BlackBoardWithOwnership.

Referenced by JoystickRemoteBlackBoardPoster::joystick_changed(), and fawkes::BlackBoardWithOwnership::try_aliveness_restore().

◆ unregister_listener()

void fawkes::BlackBoard::unregister_listener ( BlackBoardInterfaceListener listener)
virtual

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

Reimplemented in fawkes::BlackBoardWithOwnership.

Definition at line 218 of file blackboard.cpp.

References __notifier, and fawkes::BlackBoardNotifier::unregister_listener().

Referenced by FestivalSynthThread::finalize(), PanTiltDirectedPerceptionThread::finalize(), PanTiltSonyEviD100PThread::finalize(), FliteSynthThread::finalize(), RosJointThread::finalize(), RosPosition3DThread::finalize(), NavGraphGeneratorThread::finalize(), NaoQiLedThread::finalize(), LaserPointCloudThread::finalize(), RosLaserScanThread::finalize(), PanTiltRX28Thread::finalize(), DynamixelDriverThread::finalize(), NavGraphClustersThread::finalize(), BBLoggerThread::finalize(), RosTfThread::finalize(), FvAcquisitionThread::finalize(), SkillerExecutionThread::finalize(), KatanaActThread::finalize(), AmclThread::finalize(), RobotStatePublisherThread::finalize(), BlackBoardSynchronizationThread::loop(), BatteryMonitorTreeView::rem_host(), fawkes::BlackBoardWithOwnership::unregister_listener(), fawkes::BlackBoardNetHandlerInterfaceListener::~BlackBoardNetHandlerInterfaceListener(), fawkes::BlackBoardOnMessageWaker::~BlackBoardOnMessageWaker(), fawkes::BlackBoardOnUpdateWaker::~BlackBoardOnUpdateWaker(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), NaoGuiGtkWindow::~NaoGuiGtkWindow(), SkillGuiGtkWindow::~SkillGuiGtkWindow(), SyncInterfaceListener::~SyncInterfaceListener(), and fawkes::tf::TransformListener::~TransformListener().

◆ unregister_observer()

◆ update_listener()

Member Data Documentation

◆ __notifier


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