GCell Set, sorted by density. More...
Public Member Functions | |
GCellDensitySet (unsigned int depth) | |
GCellDensitySet (unsigned int depth, const std::vector< GCell *> &) | |
~GCellDensitySet () | |
bool | empty () const |
size_t | size () const |
const std::set< GCell *, GCell::CompareByKey > & | getGCells () const |
void | insert (GCell *) |
void | erase (GCell *) |
void | unqueue (GCell *) |
void | requeue () |
GCell Set, sorted by density.
A small container helper to manage a set of GCell sorted by density on a specific layer depth
.
The helper is implemented in term of a set. Once inserted in a set an element must not have is sorting key changed. But GCell density may change due to AutoSegment modifications during the lifetime of the set. To circumvent this problem, the GCell provide a key attribute to be used specifically with GCellDensitySet. This key act as a cached copy of the GCell density which is updated only by a call to GCell::updateKey() (and not GCell::updateDensity()). GCell which density have changed and key has to be updated must be signaled to set with the GCellDensityQueue::unqueue() method. When we want to update the sorting of the set on the new densities, we call GCellDensitySet::requeue() which, for each invalidated GCell do:
Typical usage:
GCellDensitySet | ( | unsigned int | depth | ) |
Create a new empty GCellDensitySet, sorting on density of layer depth
.
GCellDensitySet | ( | unsigned int | depth, |
const std::vector< GCell *> & | gcells | ||
) |
Create a new empty GCellDensitySet, sorting on density of layer depth
. Load the queue with the GCells supplied in the gcells
vector.
References GCellDensitySet::requeue().
~GCellDensitySet | ( | ) |
Delete a GCellDensitySet, if the queue is not empty, issue a warning.
|
inline |
Returns: true if the queue is empty.
|
inline |
Returns: the numbers of elements in the queue.
|
inline |
Returns: the list of GCells currently in the queue.
|
inline |
Insert gcell
into the set.
|
inline |
Remove gcell
from the set.
|
inline |
Invalidate gcell
. The density of gcell
may have changed and needs to be reinserted into the queue. It is temporarily set asides until the next call to GCellDensitySet::requeue().
void requeue | ( | ) |
Reinsert in the queue all the GCells that have been previously invalidated by a call to GCellDensitySet::unqueue(). This function calls GCell::updateKey() before reinserting the GCell.
Referenced by GCellDensitySet::GCellDensitySet().
Generated by doxygen 1.8.14 on Mon Feb 3 2020 | Return to top of page |
Katabatic - Routing Toolbox | Copyright © 2008-2016 UPMC. All rights reserved |