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> 31 #include <core/utils/rwlock_map.h> 63 unsigned int event_instance_serial)
throw();
65 unsigned int event_instance_serial)
throw();
67 unsigned int event_instance_serial)
throw();
69 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,
Interface *interface,
98 Mutex *mutex,
unsigned int &events,
99 BBilMap &map, BBilQueue &queue,
106 void queue_listener(
bool op,
Interface *interface,
117 void process_writer_queue();
118 void process_reader_queue();
119 void process_data_queue();
120 void process_bbio_queue();
122 bool is_in_queue(
bool op, BBilQueue &queue,
const char *uid,
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;
void notify_of_reader_added(const Interface *interface, unsigned int event_instance_serial)
Notify that reader has been added.
ListenerRegisterFlag
Flags to constrain listener registration/updates.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
void notify_of_interface_created(const char *type, const char *id)
Notify that an interface has been created.
void update_listener(BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
Update BB event listener.
void notify_of_writer_added(const Interface *interface, unsigned int event_instance_serial)
Notify that writer has been added.
Fawkes library namespace.
BlackBoardNotifier()
Constructor.
void notify_of_writer_removed(const Interface *interface, unsigned int event_instance_serial)
Notify that writer has been removed.
void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
void notify_of_data_change(const Interface *interface)
Notify of data change.
Base class for all Fawkes BlackBoard interfaces.
void unregister_listener(BlackBoardInterfaceListener *listener)
Unregister BB interface listener.
void notify_of_interface_destroyed(const char *type, const char *id)
Notify that an interface has been destroyed.
BlackBoard interface observer.
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 ...
virtual ~BlackBoardNotifier()
Destructor.
void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
Mutex mutual exclusion lock.
void notify_of_reader_removed(const Interface *interface, unsigned int event_instance_serial)
Notify that reader has been removed.
void register_listener(BlackBoardInterfaceListener *listener, BlackBoard::ListenerRegisterFlag flag)
Register BB event listener.
BlackBoard interface listener.