23 #include <blackboard/blackboard.h> 24 #include <blackboard/internal/notifier.h> 169 BlackBoard::BlackBoard(
bool create_notifier)
171 if (create_notifier) {
179 BlackBoard::~BlackBoard()
194 __notifier->register_listener(listener, flag);
207 if (! listener)
return;
208 __notifier->update_listener(listener, flag);
221 if (! listener)
return;
222 __notifier->unregister_listener(listener);
233 if (! observer)
return;
234 __notifier->register_observer(observer);
247 if (! observer)
return;
248 __notifier->unregister_observer(observer);
260 BlackBoard::demangle_fawkes_interface_name(
const char *type)
262 std::string t = type;
264 t = t.substr( t.find_first_not_of(
"0123456789") );
265 t = t.substr(0, t.length() - 1);
276 BlackBoard::format_identifier(
const char *identifier_format, va_list arg)
279 if (vasprintf(&
id, identifier_format, arg) != -1 ) {
280 std::string id_s(
id);
284 throw Exception(
"Failed to generate identifier from format");
299 BlackBoard::open_for_reading_f(
const char *interface_type,
300 const char *identifier, ...)
303 va_start(arg, identifier);
304 Interface *iface = open_for_reading(interface_type,
305 format_identifier(identifier, arg).c_str());
326 BlackBoard::open_for_writing_f(
const char *interface_type,
327 const char *identifier, ...)
330 va_start(arg, identifier);
331 Interface *iface = open_for_writing(interface_type,
332 format_identifier(identifier, arg).c_str());
ListenerRegisterFlag
Flags to constrain listener registration/updates.
Fawkes library namespace.
A NULL pointer was supplied where not allowed.
Base class for all Fawkes BlackBoard interfaces.
Base class for exceptions in Fawkes.
BlackBoard interface observer.
BlackBoard interface listener.