24 #ifndef _BLACKBOARD_NOTIFIER_H_
25 #define _BLACKBOARD_NOTIFIER_H_
27 #include <blackboard/blackboard.h>
28 #include <blackboard/interface_listener.h>
29 #include <blackboard/interface_observer.h>
30 #include <core/utils/rwlock_map.h>
31 #include <utils/uuid.h>
77 typedef std::list<BBilQueueEntry> BBilQueue;
79 typedef std::multimap<std::string, BlackBoardInterfaceListener *> BBilMap;
80 typedef std::pair<BlackBoardInterfaceObserver *, std::list<std::string>> BBioPair;
81 typedef std::list<BBioPair> BBioList;
82 typedef std::map<std::string, BBioList> BBioMap;
85 typedef std::pair<unsigned int, BlackBoardInterfaceObserver *> BBioQueueEntry;
86 typedef std::list<BBioQueueEntry> BBioQueue;
88 typedef BBilMap::iterator BBilMapIterator;
90 typedef BBioList::iterator BBioListIterator;
91 typedef BBioMap::iterator BBioMapIterator;
93 void proc_listener_maybe_queue(
bool op,
97 unsigned int & events,
104 void queue_listener(
bool op,
115 void process_writer_queue();
116 void process_reader_queue();
117 void process_data_queue();
118 void process_bbio_queue();
123 BBilMap bbil_reader_;
124 BBilMap bbil_writer_;
125 BBilMap bbil_messages_;
127 Mutex * bbil_unregister_mutex_;
128 BBilQueue bbil_unregister_queue_;
130 Mutex * bbil_writer_mutex_;
131 unsigned int bbil_writer_events_;
132 BBilQueue bbil_writer_queue_;
134 Mutex * bbil_reader_mutex_;
135 unsigned int bbil_reader_events_;
136 BBilQueue bbil_reader_queue_;
138 Mutex * bbil_data_mutex_;
139 unsigned int bbil_data_events_;
140 BBilQueue bbil_data_queue_;
142 Mutex * bbil_messages_mutex_;
143 unsigned int bbil_messages_events_;
144 BBilQueue bbil_messages_queue_;
146 BBioMap bbio_created_;
147 BBioMap bbio_destroyed_;
150 unsigned int bbio_events_;
151 BBioQueue bbio_queue_;
BlackBoard interface listener.
BlackBoard interface observer.
BlackBoardNotifier()
Constructor.
void notify_of_writer_added(const Interface *interface, Uuid event_instance_serial) noexcept
Notify that writer has been added.
void notify_of_writer_removed(const Interface *interface, Uuid event_instance_serial) noexcept
Notify that writer has been removed.
void unregister_listener(BlackBoardInterfaceListener *listener)
Unregister BB interface listener.
void notify_of_interface_destroyed(const char *type, const char *id) noexcept
Notify that an interface has been destroyed.
void notify_of_reader_added(const Interface *interface, Uuid event_instance_serial) noexcept
Notify that reader has been added.
virtual ~BlackBoardNotifier()
Destructor.
void notify_of_reader_removed(const Interface *interface, Uuid event_instance_serial) noexcept
Notify that reader has been removed.
void notify_of_data_refresh(const Interface *interface, bool has_changed)
Notify of data change.
void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
void register_listener(BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
Register BB event listener.
void notify_of_interface_created(const char *type, const char *id) noexcept
Notify that an interface has been created.
void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
void update_listener(BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
Update BB event listener.
bool notify_of_message_received(const Interface *interface, Message *message)
Notify of message received Notify all subscribers of the given interface of an incoming message This ...
ListenerRegisterFlag
Flags to constrain listener registration/updates.
Base class for all Fawkes BlackBoard interfaces.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Mutex mutual exclusion lock.
A convenience class for universally unique identifiers (UUIDs).
Fawkes library namespace.