26 #include <blackboard/bbconfig.h> 27 #include <blackboard/exceptions.h> 28 #include <blackboard/local.h> 29 #include <core/exceptions/system.h> 30 #include <interfaces/TestInterface.h> 31 #include <logging/liblogger.h> 43 main(
int argc,
char **argv)
56 cout <<
"Opening interfaces.. " << flush;
63 cout <<
"success" << endl;
65 cout <<
"failed! Aborting" << endl;
70 std::list<Interface *> readers = bb->open_multiple_for_reading(
"TestInterface");
71 for (std::list<Interface *>::iterator i = readers.begin(); i != readers.end(); ++i) {
72 printf(
"Opened reader for interface %s of type %s\n", (*i)->id(), (*i)->type());
76 const char *pattern =
"AnotherID *";
77 readers = bb->open_multiple_for_reading(
"TestInterface", pattern);
78 printf(
"Found %zu interfaces with pattern \"%s\"\n", readers.size(), pattern);
79 for (std::list<Interface *>::iterator i = readers.begin(); i != readers.end(); ++i) {
80 printf(
"Opened reader for interface %s of type %s\n", (*i)->id(), (*i)->type());
84 bb->
close(ti_writer_1);
85 bb->
close(ti_writer_2);
86 bb->
close(ti_writer_3);
87 bb->
close(ti_writer_4);
88 bb->
close(ti_writer_5);
89 bb->
close(ti_writer_6);
92 LibLogger::finalize();
Fawkes library namespace.
Base class for exceptions in Fawkes.
void print_trace()
Prints trace to stderr.
The BlackBoard abstract class.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
TestInterface Fawkes BlackBoard Interface.
virtual void close(Interface *interface)=0
Close interface.