24 #include <blackboard/blackboard.h> 25 #include <blackboard/net/interface_observer.h> 26 #include <blackboard/net/messages.h> 27 #include <logging/liblogger.h> 28 #include <netcomm/fawkes/hub.h> 29 #include <netcomm/fawkes/component_ids.h> 53 __blackboard = blackboard;
76 BlackBoardNetHandlerInterfaceObserver::send_event(
unsigned int msg_id,
77 const char *type,
const char *
id)
80 strncpy(esm->
type, type, __INTERFACE_TYPE_SIZE);
81 strncpy(esm->
id,
id, __INTERFACE_ID_SIZE);
87 "Failed to send BlackBoard event (%s), exception follows",
88 (msg_id == MSG_BB_INTERFACE_CREATED) ?
"create" :
"destroy");
95 const char *
id)
throw()
97 send_event(MSG_BB_INTERFACE_CREATED, type,
id);
103 const char *
id)
throw()
105 send_event(MSG_BB_INTERFACE_DESTROYED, type,
id);
virtual void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
char type[__INTERFACE_TYPE_SIZE]
interface type name
BlackBoardNetHandlerInterfaceObserver(BlackBoard *blackboard, FawkesNetworkHub *hub)
Constructor.
Fawkes library namespace.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
void bbio_add_observed_destroy(const char *type_pattern, const char *id_pattern="*")
Add interface destruction type to watch list.
virtual ~BlackBoardNetHandlerInterfaceObserver()
Destructor.
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*")
Add interface creation type to watch list.
Base class for exceptions in Fawkes.
virtual void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
virtual void broadcast(FawkesNetworkMessage *msg)=0
Method to broadcast a message to all connected clients.
static void log_warn(const char *component, const char *format,...)
Log warning message.
Message for interface events.
The BlackBoard abstract class.
virtual void bb_interface_destroyed(const char *type, const char *id)
BlackBoard interface destroyed notification.
char id[__INTERFACE_ID_SIZE]
interface instance ID