robotology/event-driven

improved qAllocator

arrenglover opened this issue · 2 comments

Update:

  1. class name?
  2. you should be able to getNextQ() without getting the envelope/timstamp.
  3. implement a new method that does scapQ() plus getNextQ() so the user doesn't need to remember to scrapqs.

We should also look at removing the double buffered list that comes from wrapping around a yarp::os::BufferedPort<> and remove the double memory allocation that comes from allocating into a bottle before decoding into a vQueue. If the vQueue is a yarp::os::PortReader/PortWriter we should be able to decode directly into the vQueue.

Design choice: make qAllocator a BufferedPort<vQueue> witch extra functions to calculate the delay in events/event time. This could be messy as we would need to extend the reading function of buffered port.
or
make qAllocator a class of its own with a standard yarp::os::Port for reading.

new classes for reading and writing events on ports have been made. The ports offer a ~50% speedup over using the old ports in terms of cpu usage and delay introduced from communications.