Fawkes API
Fawkes Development Version
|
20 #include "blackboard_listener_thread.h"
22 #include <core/threading/mutex_locker.h>
29 BlackboardListenerThread::BlackboardListenerThread()
30 :
Thread(
"ProtoboardBlackboardManager",
Thread::OPMODE_WAITFORWAKEUP),
61 bbio_add_observed_create(type_pattern, id_pattern);
62 bbio_add_observed_destroy(type_pattern, id_pattern);
70 bbil_add_data_interface(interface);
112 return !iface_events_.empty();
118 shared_ptr<BlackboardListenerThread::Event>
122 shared_ptr<BlackboardListenerThread::Event> rv = iface_events_.front();
130 BlackboardListenerThread::Created::operator EC_word()
132 return ::term(EC_functor(
"bb_created", 1), uid().c_str());
138 BlackboardListenerThread::Destroyed::operator EC_word()
140 return ::term(EC_functor(
"bb_destroyed", 1), uid().c_str());
146 BlackboardListenerThread::Changed::operator EC_word()
148 return ::term(EC_functor(
"bb_changed", 1), uid().c_str());
An interface was destroyed.
static BlackboardListenerThread * instance()
Get the singleton instance of this thread.
BlackBoard interface listener.
A new interface was created.
virtual void bb_interface_destroyed(const char *type, const char *id) noexcept override
Called by the BlackBoardInterfaceObserver when an interface is destroyed.
void observe_pattern(const char *type_pattern, const char *id_pattern) noexcept
Trigger events if an interface matching the pattern is created or destroyed.
shared_ptr< Event > event_pop()
Return and remove the next event in the queue.
static void cleanup_instance()
Delete singleton instance, e.g.
Keeps a queue of subscribed blackboard events that can be queried in a thread-safe manner.
Fawkes library namespace.
virtual void bb_interface_data_changed(Interface *interface) noexcept override
Called by the BlackBoardInterfaceListener when an interface changes.
void listen_for_change(Interface *interface) noexcept
Register.
Base class for all Fawkes BlackBoard interfaces.
bool event_pending()
Test whether any events are in the queue.
Thread class encapsulation of pthreads.
virtual void bb_interface_created(const char *type, const char *id) noexcept override
Called by the BlackBoardInterfaceObserver when an interface matching a subscribed pattern is created.