The priority Queue of RoutingEvent. More...
Public Member Functions | |
RoutingEventQueue () | |
~RoutingEventQueue () | |
bool | empty () const |
size_t | size () const |
unsigned int | getTopEventLevel () const |
RoutingEvent * | pop () |
void | load (const vector< TrackElement *> &) |
void | add (TrackElement *, unsigned int level) |
void | push (RoutingEvent *) |
void | repush (RoutingEvent *) |
void | repushInvalidateds () |
void | commit () |
void | clear () |
The priority Queue of RoutingEvent.
The RoutingEventQueue is build upon a STL multiset<> and is sorted according to the RoutingEvent::Key attribute of the event. The key attribute has been designed specifically to be used with this queue. It provides the features:
For more details about the sorting order, refer to RoutingEvent::Key.
Insertion, Reinsertion & Commit
When pushing a new event into the queue, the actual insertion into the multimap is delayed until the next call to RoutingEvent::commit()
. The to be inserted events are stored into a request set which is processed when commit is called. At commit time, the RoutingEvent::Key cache is updated just before inserting the element.
When repushing an event, the event is immediatly withdrawn from the queue and put into the request set.
Mutiple Event for one Segment
As RoutingEvent can be cloned, there may be more than one event pointing to a segment. But there must be only one active event, the one which is pointed to by the segment. As a result, there maybe multiple events for an unique segment in the queue, but only one active event, the one that will be processed.
Contructor, create an empty queue.
~RoutingEventQueue | ( | ) |
Destructor.
|
inline |
Returns: true if there is the queue is empty.
|
inline |
Returns: The number of events in the queue.
|
inline |
Returns: The greatest event level the queue has ever reached (always increasing, starting from zero).
RoutingEvent * pop | ( | ) |
Remove the top element of the queue (i.e. the one with the highest priority) and return it. If the queue is empty, NULL
is returned.
void load | ( | const vector< TrackElement *> & | segments | ) |
Load a whole vector of TrackElement into the queue, for each element:
No commit is needed after this operation.
void add | ( | TrackElement * | element, |
unsigned int | level | ||
) |
Create a new RoutingEvent in the queue with level
, associated to element
. A commit is needed afterwards.
To be reviewed: replace any previous event on element.
Referenced by NegociateWindow::addRoutingEvent().
|
inline |
Push a RoutingEvent in the queue. Effective only after the next commit.
Referenced by RoutingEventQueue::add(), and RoutingEventQueue::repush().
void repush | ( | RoutingEvent * | event | ) |
Force a complete queue re-insertion for event
. The event is immediatly withdrawn from the queue and put into the insertion request set.
If the event
is not already in the queue, works like RoutingEventQueue::push().
Referenced by RoutingEventQueue::repushInvalidateds(), and RoutingEvent::reschedule().
void repushInvalidateds | ( | ) |
Using the list of invalidated segments from the Session, repush them if:
Referenced by RoutingEvent::process().
void commit | ( | ) |
Process the insertion request set and actually insert it's elements into the queue. Perform a RoutingEvent::key update prior to insertion.
Referenced by RoutingEvent::process().
void clear | ( | ) |
Empty the queue. Issue a warning if the queue is not empty (i.e. some events remains to be processeds).
Referenced by RoutingEventQueue::~RoutingEventQueue().
Generated by doxygen 1.8.14 on Sun May 26 2019 | Return to top of page |
Kite - Detailed Router | Copyright © 2008-2016 UPMC. All rights reserved |