// Maintains multiple queues of sorted sensor data and dispatches it in merge // sorted order. It will wait to see at least one value for each unfinished // queue before dispatching the next time ordered value across all queues. // 维护排序后的传感器数据的多个队列, 并按合并排序的顺序进行调度 // 它将等待为每个未完成的队列查看至少一个值, 然后再在所有队列中分派下一个按时间排序的值.
// Adds a new queue with key 'queue_key' which must not already exist. // 'callback' will be called whenever data from this queue can be dispatched. voidAddQueue(const QueueKey& queue_key, Callback callback);
// Marks a queue as finished, i.e. no further data can be added. The queue // will be removed once the last piece of data from it has been dispatched. voidMarkQueueAsFinished(const QueueKey& queue_key);
// Adds 'data' to a queue with the given 'queue_key'. Data must be added // sorted per queue. voidAdd(const QueueKey& queue_key, std::unique_ptr<Data> data);
// Dispatches all remaining values in sorted order and removes the underlying // queues. voidFlush();
// Must only be called if at least one unfinished queue exists. Returns the // key of a queue that needs more data before the OrderedMultiQueue can // dispatch data. QueueKey GetBlocker()const;