27 #include <blackboard/local.h> 28 #include <blackboard/exceptions.h> 29 #include <blackboard/bbconfig.h> 31 #include <interfaces/TestInterface.h> 32 #include <interface/interface_info.h> 34 #include <core/exceptions/system.h> 51 signal_handler(
int signum)
60 main(
int argc,
char **argv)
63 signal(SIGINT, signal_handler);
71 cout <<
"Opening interfaces.. " << flush;
74 cout <<
"success, " <<
78 cout <<
"failed! Aborting" << endl;
83 cout <<
"Listing interfaces.." << endl;
85 for (InterfaceInfoList::iterator i = infl->begin(); i != infl->end(); ++i) {
86 const unsigned char *hash = (*i).hash();
87 char phash[__INTERFACE_HASH_SIZE * 2 + 1];
88 memset(phash, 0,
sizeof(phash));
89 for (
unsigned int j = 0; j < __INTERFACE_HASH_SIZE; ++j) {
90 sprintf(&phash[j * 2],
"%02x", hash[j]);
92 printf(
"%s::%s (%s), w:%i r:%u s:%u\n",
93 (*i).type(), (*i).id(), phash, (*i).has_writer(),
94 (*i).num_readers(), (*i).serial());
Fawkes library namespace.
Interface information list.
Base class for exceptions in Fawkes.
void print_trace()
Prints trace to stderr.
virtual InterfaceInfoList * list_all()=0
Get list of all currently existing interfaces.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
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.
const char * hash_printable() const
Get printable interface hash.
virtual void close(Interface *interface)=0
Close interface.