Fawkes API  Fawkes Development Version
fawkes::BlackBoardInterfaceProxy Class Reference

Interface proxy for remote BlackBoard. More...

#include <>>

Inheritance diagram for fawkes::BlackBoardInterfaceProxy:

Public Member Functions

 BlackBoardInterfaceProxy (FawkesNetworkClient *client, FawkesNetworkMessage *msg, BlackBoardNotifier *notifier, Interface *interface, bool readwrite)
 Constructor. More...
 
 ~BlackBoardInterfaceProxy ()
 Destructor. More...
 
void process_data_changed (FawkesNetworkMessage *msg)
 Process MSG_BB_DATA_CHANGED message. More...
 
void process_interface_message (FawkesNetworkMessage *msg)
 Process MSG_BB_INTERFACE message. More...
 
void reader_added (unsigned int event_serial)
 Reader has been added. More...
 
void reader_removed (unsigned int event_serial)
 Reader has been removed. More...
 
void writer_added (unsigned int event_serial)
 Writer has been added. More...
 
void writer_removed (unsigned int event_serial)
 Writer has been removed. More...
 
unsigned int serial () const
 Get instance serial of interface. More...
 
unsigned int clid () const
 Get client ID of assigned client. More...
 
Interfaceinterface () const
 Get instance serial of interface. More...
 
virtual bool exists_writer (const Interface *interface) const
 Check if a writer exists for the given interface. More...
 
virtual unsigned int num_readers (const Interface *interface) const
 Get number of readers. More...
 
virtual void notify_of_data_change (const Interface *interface)
 Notify of data change. More...
 
virtual std::list< std::string > readers (const Interface *interface) const
 Get owners of interfaces who opened for reading. More...
 
virtual std::string writer (const Interface *interface) const
 Get writer of interface. More...
 
virtual void transmit (Message *message)
 Transmit message. More...
 
- Public Member Functions inherited from fawkes::InterfaceMediator
virtual ~InterfaceMediator ()
 Virtual destructor. More...
 
- Public Member Functions inherited from fawkes::MessageMediator
virtual ~MessageMediator ()
 Virtual destructor. More...
 

Detailed Description

Interface proxy for remote BlackBoard.

This proxy is used internally by RemoteBlackBoard to interact with an interface on the one side and the remote BlackBoard on the other side.

Author
Tim Niemueller

Definition at line 39 of file interface_proxy.h.

Constructor & Destructor Documentation

◆ BlackBoardInterfaceProxy()

fawkes::BlackBoardInterfaceProxy::BlackBoardInterfaceProxy ( FawkesNetworkClient client,
FawkesNetworkMessage msg,
BlackBoardNotifier notifier,
Interface interface,
bool  writer 
)

Constructor.

Parameters
clientFawkes network client
msgmust be a MSG_BB_OPEN_SUCCESS message describing the interface in question
notifierBlackBoard notifier to use to notify of interface events
interfaceinterface instance of the correct type, will be initialized in this ctor and can be used afterwards.
writertrue to make this a writing instance, false otherwise

Definition at line 56 of file interface_proxy.cpp.

References fawkes::FawkesNetworkMessage::clid(), fawkes::bb_iopensucc_msg_t::data_size, fawkes::Interface::datasize(), fawkes::interface_header_t::flag_writer_active, fawkes::interface_header_t::hash, fawkes::Interface::hash(), fawkes::interface_header_t::id, fawkes::Interface::id(), interface(), fawkes::FawkesNetworkMessage::msgid(), fawkes::interface_header_t::num_readers, fawkes::FawkesNetworkMessage::payload(), fawkes::interface_header_t::refcount, fawkes::bb_iopensucc_msg_t::serial, fawkes::interface_header_t::type, fawkes::Interface::type(), and fawkes::bb_iopensucc_msg_t::writer_readers.

◆ ~BlackBoardInterfaceProxy()

fawkes::BlackBoardInterfaceProxy::~BlackBoardInterfaceProxy ( )

Destructor.

Definition at line 105 of file interface_proxy.cpp.

Member Function Documentation

◆ clid()

unsigned int fawkes::BlackBoardInterfaceProxy::clid ( ) const

Get client ID of assigned client.

Returns
client ID

Definition at line 257 of file interface_proxy.cpp.

◆ exists_writer()

bool fawkes::BlackBoardInterfaceProxy::exists_writer ( const Interface interface) const
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

Implements fawkes::InterfaceMediator.

Definition at line 274 of file interface_proxy.cpp.

◆ interface()

Interface * fawkes::BlackBoardInterfaceProxy::interface ( ) const

Get instance serial of interface.

Returns
instance serial

Definition at line 266 of file interface_proxy.cpp.

Referenced by BlackBoardInterfaceProxy().

◆ notify_of_data_change()

void fawkes::BlackBoardInterfaceProxy::notify_of_data_change ( const Interface interface)
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()

Implements fawkes::InterfaceMediator.

Definition at line 299 of file interface_proxy.cpp.

References fawkes::bb_idata_msg_t::data_size, fawkes::Interface::datachunk(), fawkes::Interface::datasize(), fawkes::FawkesNetworkClient::enqueue(), fawkes::Interface::serial(), and fawkes::bb_idata_msg_t::serial.

◆ num_readers()

unsigned int fawkes::BlackBoardInterfaceProxy::num_readers ( const Interface interface) const
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.

Implements fawkes::InterfaceMediator.

Definition at line 280 of file interface_proxy.cpp.

◆ process_data_changed()

void fawkes::BlackBoardInterfaceProxy::process_data_changed ( FawkesNetworkMessage msg)

◆ process_interface_message()

◆ reader_added()

void fawkes::BlackBoardInterfaceProxy::reader_added ( unsigned int  event_serial)

Reader has been added.

Parameters
event_serialinstance serial of the interface that caused the event

Definition at line 204 of file interface_proxy.cpp.

References fawkes::BlackBoardNotifier::notify_of_reader_added().

◆ reader_removed()

void fawkes::BlackBoardInterfaceProxy::reader_removed ( unsigned int  event_serial)

Reader has been removed.

Parameters
event_serialinstance serial of the interface that caused the event

Definition at line 214 of file interface_proxy.cpp.

References fawkes::BlackBoardNotifier::notify_of_reader_removed().

◆ readers()

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

Get owners of interfaces who opened for reading.

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

Implements fawkes::InterfaceMediator.

Definition at line 286 of file interface_proxy.cpp.

◆ serial()

unsigned int fawkes::BlackBoardInterfaceProxy::serial ( ) const

Get instance serial of interface.

Returns
instance serial

Definition at line 247 of file interface_proxy.cpp.

Referenced by fawkes::RemoteBlackBoard::try_aliveness_restore().

◆ transmit()

void fawkes::BlackBoardInterfaceProxy::transmit ( Message message)
virtual

◆ writer()

std::string fawkes::BlackBoardInterfaceProxy::writer ( const Interface interface) const
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

Implements fawkes::InterfaceMediator.

Definition at line 293 of file interface_proxy.cpp.

◆ writer_added()

void fawkes::BlackBoardInterfaceProxy::writer_added ( unsigned int  event_serial)

Writer has been added.

Parameters
event_serialinstance serial of the interface that caused the event

Definition at line 226 of file interface_proxy.cpp.

References fawkes::BlackBoardNotifier::notify_of_writer_added().

◆ writer_removed()

void fawkes::BlackBoardInterfaceProxy::writer_removed ( unsigned int  event_serial)

Writer has been removed.

Parameters
event_serialinstance serial of the interface that caused the event

Definition at line 236 of file interface_proxy.cpp.

References fawkes::BlackBoardNotifier::notify_of_writer_removed().


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