class set_iterator #( type T = int ) extends iterator#( T )
Provides an iterator to a set.
| T | optional The type of data collected in a set. The default is int. |
| set_iterator | Provides an iterator to a set. |
| Types | |
| aa_type | The shorthand of the associative array type of type T. |
| set_type | The shorthand of the set type of type T. |
| Functions | |
| new | Creates a set iterator. |
| has_next | virtual Returns 1 if the iterator has more elements. |
| next | virtual Returns the next element. |
| remove | virtual Removes the last element returned by the iterator. |
typedef set#( T ) set_type
The shorthand of the set type of type T.
virtual function void remove()
virtual Removes the last element returned by the iterator. This function can be called once per call to next.
Provides an iterator to a set.
class set_iterator #( type T = int ) extends iterator#( T )
Implements the set_base using an associative array.
class set #( type T = int ) extends set_base#( T )
The shorthand of the associative array type of type T.
typedef bit aa_type[T]
The shorthand of the set type of type T.
typedef set#( T ) set_type
Creates a set iterator.
function new( set_type s )
virtual Returns 1 if the iterator has more elements.
virtual function bit has_next()
virtual Returns the next element.
virtual function T next()
virtual Removes the last element returned by the iterator.
virtual function void remove()