svt_data_queue_iter Class Reference

Inheritance diagram for class svt_data_queue_iter:

List of all members.


Detailed Description

Iterators that can be used to iterate over a queue of svt_data instances. This iterator actually includes the queue of objects to be iterated on in addition to the iterator.



Public Member Functions

function svt_data_iter  allocate ( )
function svt_data_iter  copy ( )
function bit  first ( )
function svt_data  get_data ( )
function void  initialize ( svt_data_queue iter_q = null, svt_notify notify = null, int curr_ix = -1 )
function void  initialize_notify ( svt_notify notify = null )
function bit  is_ok ( )
function bit  last ( )
function int  length ( )
function void  new ( svt_data_queue iter_q = null, svt_notify notify = null, vmm_log log = null )
function bit  next ( )
function int  pos ( )
function bit  prev ( )
function void  queue_changed ( svt_data_queue_iter :: change_type_enum change_type = BACK_ADD )
function void  reset ( )
task   wait_for_next ( )
task   wait_for_prev ( )

Public Attributes

int  EVENT_Q_CHANGED 
svt_data_queue  iter_q 

Protected Attributes

protected svt_data  curr_data = null; 
protected int  curr_ix = -1; 
protected svt_notify  notify 

Member Typedefs

 typedef enum  change_type_enum 


Member Function Documentation

  function svt_data_iter
 svt_data_queue_iter::allocate

 (   ) 


Allocate a new instance of the iterator. The client must use copy to create a duplicate iterator working on the same information initialized to the same position.

 Superseded functions 
 svt_data_iter :: allocate 

  function svt_data_iter
 svt_data_queue_iter::copy

 (   ) 


Copy the iterator, putting the new iterator at the same position.

 Superseded functions 
 svt_data_iter :: copy 

  function bit
 svt_data_queue_iter::first

 (   ) 


Move to the first element in the collection.

 Superseded functions 
 svt_data_iter :: first 

  function svt_data
 svt_data_queue_iter::get_data

 (   ) 


Access the svt_data object at the current position.

 Superseded functions 
 svt_data_iter :: get_data 

  function void
 svt_data_queue_iter::initialize

 (  svt_data_queue iter_q = null, svt_notify notify = null, int curr_ix = -1  ) 


Initializes the iterator using the provided information.

iter_q - Queue containing the svt_data instances to be iterated upon.

notify - svt_notify instance, possibly shared.

curr_ix - This positions the top level iterator at this index.

  function void
 svt_data_queue_iter::initialize_notify

 (  svt_notify notify = null  ) 


Initializes the notify using the provided instance, or creates a new one if possible.

notify - svt_notify instance, possibly shared.

  function bit
 svt_data_queue_iter::is_ok

 (   ) 


Evaluate whether the iterator is positioned on an element.

 Superseded functions 
 svt_data_iter :: is_ok 

  function bit
 svt_data_queue_iter::last

 (   ) 


Move to the last element.

 Superseded functions 
 svt_data_iter :: last 

  function int
 svt_data_queue_iter::length

 (   ) 


Get the number of elements.

 Superseded functions 
 svt_data_iter :: length 

  function void
 svt_data_queue_iter::new

 (  svt_data_queue iter_q = null, svt_notify notify = null, vmm_log log = null  ) 


CONSTRUCTOR: Creates a new instance of the svt_data_queue_iter class.

iter_q - The queue to be scanned.

notify - notify instance used to indicate events such as EVENT_Q_CHANGED.

log - Used to replace the default message report object.

  function bit
 svt_data_queue_iter::next

 (   ) 


Move to the next element.

 Superseded functions 
 svt_data_iter :: next 

  function int
 svt_data_queue_iter::pos

 (   ) 


Get the current postion within the overall length.

 Superseded functions 
 svt_data_iter :: pos 

  function bit
 svt_data_queue_iter::prev

 (   ) 


Move to the previous element.

 Superseded functions 
 svt_data_iter :: prev 

  function void
 svt_data_queue_iter::queue_changed

 (  svt_data_queue_iter :: change_type_enum change_type = BACK_ADD  ) 


Called when the queue changes so the iterator can re-align itself and see if any waits can now proceed.

change_type - The type of queue change which occurred.

  function void
 svt_data_queue_iter::reset

 (   ) 


Reset the iterator.

 Superseded functions 
 svt_data_iter :: reset 

  task
 svt_data_queue_iter::wait_for_next

 (   ) 


Move to the next element, but only if there is a next element. If no next element exists (e.g., because the iterator is already on the last element) then the iterator will wait here until a new element is placed at the end of the list.

 Superseded tasks 
 svt_data_iter :: wait_for_next 

  task
 svt_data_queue_iter::wait_for_prev

 (   ) 


Move to the previous element, but only if there is a previous element. If no previous element exists (e.g., because the iterator is already on the first element) then the iterator will wait here until a new element is placed at the front of the list.

 Superseded tasks 
 svt_data_iter :: wait_for_prev 


Member Attribute Documentation

 protected svt_data  attribute
 svt_data_queue_iter::curr_data = null


Current data instance, used to re-align if there is a change to the queue.

 protected int  attribute
 svt_data_queue_iter::curr_ix = -1


Current iterator position.

 int  attribute
 svt_data_queue_iter::EVENT_Q_CHANGED


Event triggered when the Queue is changed.

 svt_data_queue  attribute
 svt_data_queue_iter::iter_q


The queue the iterator is scanning.

 protected svt_notify  attribute
 svt_data_queue_iter::notify


svt_notify instance that can be shared between iterators.

Member Typedef Documentation

 typedef enum  svt_data_queue_iter::change_type_enum

This enumeration indicates the type of queue change that has occurred and that must be accounted for.

FRONT_ADD
Indicates data instances were added to the front
FRONT_DELETE
Indicates data instances were deleted from the front
BACK_ADD
Indicates data instances were added to the back
BACK_DELETE
Indicates data instances were deleted from the back