23 #include <plugins/openni/utils/hand_if_observer.h> 25 #include <blackboard/blackboard.h> 26 #include <interfaces/ObjectPositionInterface.h> 49 __queue_lock =
new Mutex();
52 std::list<ObjectPositionInterface *> hand_ifs =
55 std::list<ObjectPositionInterface *>::iterator i;
56 for (i = hand_ifs.begin(); i != hand_ifs.end(); ++i) {
77 if (__hands.find(
id) == __hands.end()) {
79 __queues[__active_queue].push(
id);
91 unsigned int proc_queue = __active_queue;
92 __active_queue = 1 - __active_queue;
94 while (! __queues[proc_queue].empty()) {
95 std::string
id = __queues[proc_queue].front();
107 __queues[proc_queue].pop();
virtual void register_observer(BlackBoardInterfaceObserver *observer)
Register BB interface observer.
ObjectPositionInterface Fawkes BlackBoard Interface.
Hand info to pass to draw_skeletons().
Fawkes library namespace.
void unlock()
Unlock the mutex.
const char * id() const
Get identifier of interface.
virtual void bb_interface_created(const char *type, const char *id)
BlackBoard interface created notification.
void process_queue()
Process internal queue.
void bbio_add_observed_create(const char *type_pattern, const char *id_pattern="*")
Add interface creation type to watch list.
Base class for exceptions in Fawkes.
HandIfObserver(BlackBoard *bb, HandMap &hands)
Constructor.
virtual void unregister_observer(BlackBoardInterfaceObserver *observer)
Unregister BB interface observer.
virtual std::list< Interface * > open_multiple_for_reading(const char *type_pattern, const char *id_pattern="*", const char *owner=NULL)=0
Open multiple interfaces for reading.
void print_trace()
Prints trace to stderr.
virtual Interface * open_for_reading(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for reading.
fawkes::ObjectPositionInterface * hand_if
Hand pos interface.
~HandIfObserver()
Destructor.
void lock()
Lock this mutex.
The BlackBoard abstract class.
Mutex mutual exclusion lock.