[source]

Class uvm_pkg::uvm_callback_iter

CLASS

uvm_callback_iter

The uvm_callback_iter class is an iterator class for iterating over callback queues of a specific callback type. The typical usage of the class is:

 uvm_callback_iter#(mycomp,mycb) iter = new(this);
 for(mycb cb = iter.first(); cb != null; cb = iter.next())
    cb.dosomething();

The callback iteration macros, uvm_do_callbacks](../../../../index-macros.html#macros) and [uvm_do_callbacks_exit_on provide a simple method for iterating callbacks and executing the callback methods.

Parameters

Name

Default value

Description

T

uvm_object

CB

uvm_callback

Constructors

new(uvm_object obj)

Function

new

Creates a new callback iterator object. It is required that the object context be provided.

Parameters:

obj (uvm_object)

Functions

first()

Function

first

Returns the first valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context object. If the queue is empty then null is returned.

Return type:

CB

last()

Function

last

Returns the last valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context object. If the queue is empty then null is returned.

Return type:

CB

next()

Function

next

Returns the next valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context object. If there are no more valid callbacks in the queue, then null is returned.

Return type:

CB

prev()

Function

prev

Returns the previous valid (enabled) callback of the callback type (or a derivative) that is in the queue of the context object. If there are no more valid callbacks in the queue, then null is returned.

Return type:

CB

get_cb()

Function

get_cb

Returns the last callback accessed via a first() or next() call.

Return type:

CB