Remote BlackBoard. More...
#include <>>
Public Member Functions | |
RemoteBlackBoard (FawkesNetworkClient *client) | |
Constructor. | |
RemoteBlackBoard (const char *hostname, unsigned short int port) | |
Constructor. | |
virtual | ~RemoteBlackBoard () |
Destructor. | |
virtual Interface * | open_for_reading (const char *interface_type, const char *identifier) |
virtual Interface * | open_for_writing (const char *interface_type, const char *identifier) |
virtual void | close (Interface *interface) |
Close interface. | |
virtual InterfaceInfoList * | list_all () |
virtual bool | is_alive () const throw () |
virtual bool | try_aliveness_restore () throw () |
std::list< Interface * > | open_multiple_for_reading (const char *interface_type, const char *id_pattern="*") |
void | register_listener (BlackBoardInterfaceListener *listener, unsigned int flags) |
void | unregister_listener (BlackBoardInterfaceListener *listener) |
void | register_observer (BlackBoardInterfaceObserver *observer, unsigned int flags) |
void | unregister_observer (BlackBoardInterfaceObserver *observer) |
virtual void | deregistered (unsigned int id) throw () |
We are no longer registered in Fawkes network client. | |
virtual void | inbound_received (FawkesNetworkMessage *msg, unsigned int id) throw () |
Called for incoming messages. | |
virtual void | connection_died (unsigned int id) throw () |
Client connection died. | |
virtual void | connection_established (unsigned int id) throw () |
Client has established a connection. |
Remote BlackBoard.
This class implements the access to a remote BlackBoard using the Fawkes network protocol.
Definition at line 49 of file remote.h.
fawkes::RemoteBlackBoard::RemoteBlackBoard | ( | FawkesNetworkClient * | client | ) |
Constructor.
client | Fawkes network client to use. |
Definition at line 57 of file remote.cpp.
References fawkes::FawkesNetworkClient::connected(), and fawkes::FawkesNetworkClient::register_handler().
fawkes::RemoteBlackBoard::RemoteBlackBoard | ( | const char * | hostname, | |
unsigned short int | port | |||
) |
Constructor.
This will internall create a fawkes network client that is used to communicate with the remote BlackBoard.
hostname | hostname to connect to | |
port | port to connect to |
Definition at line 85 of file remote.cpp.
References fawkes::FawkesNetworkClient::connect(), fawkes::FawkesNetworkClient::connected(), and fawkes::FawkesNetworkClient::register_handler().
fawkes::RemoteBlackBoard::~RemoteBlackBoard | ( | ) | [virtual] |
Destructor.
Definition at line 115 of file remote.cpp.
References fawkes::FawkesNetworkClient::deregister_handler(), and fawkes::FawkesNetworkClient::disconnect().
void fawkes::RemoteBlackBoard::close | ( | Interface * | interface | ) | [virtual] |
Close interface.
interface | interface to close |
Definition at line 301 of file remote.cpp.
References fawkes::FawkesNetworkClient::connected(), fawkes::BlackBoardInstanceFactory::delete_interface_instance(), fawkes::FawkesNetworkClient::enqueue(), fawkes::bb_iserial_msg_t::serial, and fawkes::Interface::serial().
Referenced by RefBoxStateBBWriter::~RefBoxStateBBWriter().
void fawkes::RemoteBlackBoard::connection_died | ( | unsigned int | id | ) | throw () [virtual] |
Client connection died.
This method is used to inform handlers that the connection has died for any reason. No more data can be send and no more messages should be enqueued because it is unclear when they would be sent.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 452 of file remote.cpp.
void fawkes::RemoteBlackBoard::connection_established | ( | unsigned int | id | ) | throw () [virtual] |
Client has established a connection.
Whenever the client establishes a connection this is signaled to handlers with this method. You can register to a client at any time, you may even enqueue messages to a client while the connection is dead. If the client at some point gets connected again, the messages will then be send out in one go. You should use this in your application though to only send data if the connection is alive and you should let the user know about the connection status.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 466 of file remote.cpp.
void fawkes::RemoteBlackBoard::deregistered | ( | unsigned int | id | ) | throw () [virtual] |
We are no longer registered in Fawkes network client.
Ignored.
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 395 of file remote.cpp.
void fawkes::RemoteBlackBoard::inbound_received | ( | FawkesNetworkMessage * | m, | |
unsigned int | id | |||
) | throw () [virtual] |
Called for incoming messages.
This is called when an incoming message has been received. If this method was called one or more times then the a previously carried out wait(cid) call will continue.
m | Message to handle | |
id | the id of the calling client |
Implements fawkes::FawkesNetworkClientHandler.
Definition at line 401 of file remote.cpp.
References fawkes::bb_ieventserial_msg_t::event_serial, and fawkes::bb_ieventserial_msg_t::serial.