Fawkes API  Fawkes Development Version
fawkes::InterfaceMediator Class Referenceabstract

Interface mediator interface. More...

#include <interface_mediator.h>

Inheritance diagram for fawkes::InterfaceMediator:

Public Member Functions

virtual ~InterfaceMediator ()
 Virtual destructor. More...
 
virtual bool exists_writer (const Interface *interface) const =0
 Check if a writer exists for the given interface. More...
 
virtual unsigned int num_readers (const Interface *interface) const =0
 Get number of readers. More...
 
virtual std::list< std::string > readers (const Interface *interface) const =0
 Get owners of interfaces who opened for reading. More...
 
virtual std::string writer (const Interface *interface) const =0
 Get writer of interface. More...
 
virtual void notify_of_data_change (const Interface *interface)=0
 Notify of data change. More...
 

Detailed Description

Interface mediator interface.

An interface mediator is used by interfaces to communicate events and to query status information which need interaction with the BlackBoard.

Author
Tim Niemueller

Definition at line 39 of file interface_mediator.h.

Constructor & Destructor Documentation

◆ ~InterfaceMediator()

virtual fawkes::InterfaceMediator::~InterfaceMediator ( )
inlinevirtual

Virtual destructor.

Definition at line 43 of file interface_mediator.h.

References exists_writer(), notify_of_data_change(), num_readers(), readers(), and writer().

Member Function Documentation

◆ exists_writer()

virtual bool fawkes::InterfaceMediator::exists_writer ( const Interface interface) const
pure virtual

Check if a writer exists for the given interface.

Parameters
interfaceinterface to check
Returns
true, if there is any writer for the given interface, false otherwise

Implemented in fawkes::BlackBoardInterfaceManager, and fawkes::BlackBoardInterfaceProxy.

Referenced by ~InterfaceMediator().

◆ notify_of_data_change()

virtual void fawkes::InterfaceMediator::notify_of_data_change ( const Interface interface)
pure virtual

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()

Implemented in fawkes::BlackBoardInterfaceManager, and fawkes::BlackBoardInterfaceProxy.

Referenced by ~InterfaceMediator().

◆ num_readers()

virtual unsigned int fawkes::InterfaceMediator::num_readers ( const Interface interface) const
pure virtual

Get number of readers.

Get the number of readers that the given interface has.

Parameters
interfaceinterface to check
Returns
number of readers currently registered for the given interface.

Implemented in fawkes::BlackBoardInterfaceManager, and fawkes::BlackBoardInterfaceProxy.

Referenced by ~InterfaceMediator().

◆ readers()

virtual std::list<std::string> fawkes::InterfaceMediator::readers ( const Interface interface) const
pure virtual

Get owners of interfaces who opened for reading.

Parameters
interfacean interface to query for the UID
Returns
list of readers for this interface

Implemented in fawkes::BlackBoardInterfaceManager, and fawkes::BlackBoardInterfaceProxy.

Referenced by ~InterfaceMediator().

◆ writer()

virtual std::string fawkes::InterfaceMediator::writer ( const Interface interface) const
pure virtual

Get writer of interface.

Parameters
interfacean interface to query for the UID
Returns
owner name of writing interface instance, or empty string of no writer exists

Implemented in fawkes::BlackBoardInterfaceManager, and fawkes::BlackBoardInterfaceProxy.

Referenced by ~InterfaceMediator().


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