Locator description (API) More...
Public Member Functions | |
virtual Type | getElement () const =0 |
virtual Locator< Type > * | getClone () const =0 |
virtual bool | isValid () const =0 |
virtual void | progress ()=0 |
Locator description (API)
Locators are objects which allow to walk efficiently through the data structure.
Locators are indeed algorithms. They do not hold a list of elements but the way to go from one element to the next. As such, they are very light in memory, contrary to containers. Locators are the workhorse of Collection, and while they can be used directly, this is not the recommended way.
Initialization In order to get a locator, you must : either ask the collection to provide a locator for visiting the elements of its described set, or build a clone of an existing locator allowing to visit the remaining elements starting from the current position of that locator.
End of walk indicator The predicate isValid() returns true if the locator refers an element of the set, false when all the elements have been visited.
getting the current element The current element is obtained by the accessor getElement(). There is no risk to call this function when the visit is finished or the locator is non initialized (the returned value is meaningless).
Walk progression The function progress() moves forward the locator on the next element of the set (does nothing if called after the last element).
The following sample code shows how to trace the nets of a given cell
And this one how to print all pairs of nets of a given cell
|
pure virtual |
Returns: the current element (or the value Type() when the locator is not or no longer valid).
|
pure virtual |
This function allocates and returns a new locator that will have the same visiting course than the remaining one of the locator being cloned.
|
pure virtual |
Returns: true while the walk has not exhausted the set of elements, else false.
|
pure virtual |
Moves forward the locator to the following element.
Generated by doxygen 1.9.1 on Thu Aug 11 2022 | Return to top of page |
Hurricane VLSI Database | Copyright © 2000-2020 Bull S.A. All rights reserved |