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>
62 unsigned int event_instance_serial)
throw();
64 unsigned int event_instance_serial)
throw();
66 unsigned int event_instance_serial)
throw();
68 unsigned int event_instance_serial)
throw();
80 typedef std::list<BBilQueueEntry> BBilQueue;
82 typedef std::multimap<std::string, BlackBoardInterfaceListener *> BBilMap;
83 typedef std::pair<BlackBoardInterfaceObserver *, std::list<std::string>> BBioPair;
84 typedef std::list<BBioPair> BBioList;
85 typedef std::map<std::string, BBioList> BBioMap;
88 typedef std::pair<unsigned int, BlackBoardInterfaceObserver *> BBioQueueEntry;
89 typedef std::list<BBioQueueEntry> BBioQueue;
91 typedef BBilMap::iterator BBilMapIterator;
93 typedef BBioList::iterator BBioListIterator;
94 typedef BBioMap::iterator BBioMapIterator;
96 void proc_listener_maybe_queue(
bool op,
100 unsigned int & events,
107 void queue_listener(
bool op,
118 void process_writer_queue();
119 void process_reader_queue();
120 void process_data_queue();
121 void process_bbio_queue();
126 BBilMap bbil_reader_;
127 BBilMap bbil_writer_;
128 BBilMap bbil_messages_;
130 Mutex * bbil_unregister_mutex_;
131 BBilQueue bbil_unregister_queue_;
133 Mutex * bbil_writer_mutex_;
134 unsigned int bbil_writer_events_;
135 BBilQueue bbil_writer_queue_;
137 Mutex * bbil_reader_mutex_;
138 unsigned int bbil_reader_events_;
139 BBilQueue bbil_reader_queue_;
141 Mutex * bbil_data_mutex_;
142 unsigned int bbil_data_events_;
143 BBilQueue bbil_data_queue_;
145 Mutex * bbil_messages_mutex_;
146 unsigned int bbil_messages_events_;
147 BBilQueue bbil_messages_queue_;
149 BBioMap bbio_created_;
150 BBioMap bbio_destroyed_;
153 unsigned int bbio_events_;
154 BBioQueue bbio_queue_;
BlackBoard interface listener.
BlackBoard interface observer.
BlackBoardNotifier()
Constructor.
void notify_of_reader_added(const Interface *interface, unsigned int event_instance_serial)
Notify that reader has been added.
void notify_of_data_change(const Interface *interface)
Notify of data change.
void unregister_listener(BlackBoardInterfaceListener *listener)
Unregister BB interface listener.
void notify_of_writer_removed(const Interface *interface, unsigned int event_instance_serial)
Notify that writer has been removed.
void notify_of_writer_added(const Interface *interface, unsigned int event_instance_serial)
Notify that writer has been added.
void notify_of_interface_destroyed(const char *type, const char *id)
Notify that an interface has been destroyed.
virtual ~BlackBoardNotifier()
Destructor.
void notify_of_interface_created(const char *type, const char *id)
Notify that an interface has been created.
void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
void register_listener(BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
Register BB event listener.
void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
void notify_of_reader_removed(const Interface *interface, unsigned int event_instance_serial)
Notify that reader has been removed.
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.
Fawkes library namespace.