ASN1CSeqOfListIterator Class Reference
[Control (ASN1C_) Base Classes]

#include <ASN1CSeqOfList.h>

List of all members.

Public Member Functions

OSBOOL hasNext ()
OSBOOL hasPrev ()
EXTRTMETHOD void * next ()
EXTRTMETHOD void * prev ()
EXTRTMETHOD int remove ()
EXTRTMETHOD int set (void *data)
EXTRTMETHOD int insert (void *data)
int getState ()

Protected Member Functions

EXTRTMETHOD ASN1CSeqOfListIterator (ASN1CSeqOfList *list)
EXTRTMETHOD ASN1CSeqOfListIterator (ASN1CSeqOfList *list, OSRTDListNode *startNode)
void * operator new (size_t, void *data)
void operator delete (void *, void *)
void operator delete (void *, size_t)

Protected Attributes

ASN1CSeqOfListpSeqList
OSRTDListNodenextNode
OSRTDListNodelastNode
volatile int expectedModCount
int stat

Detailed Description

Linked list iterator class. The ASN1CSeqOfListIterator class is an iterator for linked lists (represented by ASN1CSeqOfList) that allows the programmer to traverse the list in either direction and modify the list during iteration. The iterator is fail-fast. This means the list is structurally modified at any time after the ASN1CSeqOfListIterator class is created, in any way except through the iterator's own remove or insert methods, the iterator's methods next and prev methods will return NULL. The remove, set and insert methods will return the RTERR_CONCMODF error code.


Member Function Documentation

OSBOOL ASN1CSeqOfListIterator::hasNext (  )  [inline]

This method returns TRUE if this iterator has more elements when traversing the list in the forward direction.

In other words, the method returns TRUE if the next method would return an element rather than returning a null value.

Returns:
TRUE if next would return an element rather than returning a null value.
OSBOOL ASN1CSeqOfListIterator::hasPrev (  )  [inline]

This method returns TRUE if this iterator has more elements when traversing the list in the reverse direction.

In other words, this method will return TRUE if prev would return an element rather than returning a null value.

Returns:
TRUE if next would return an element rather than returning a null value.
EXTRTMETHOD int ASN1CSeqOfListIterator::insert ( void *  data  ) 

This method inserts the specified element into the list.

The element is inserted immediately before the next element that would be returned by the next method, if any, and after the next element would be returned by the prev method, if any. If the list contains no elements, the new element becomes the sole element in the list. The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to prev would return the new element.

Parameters:
data The element to be inserted
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
EXTRTMETHOD void* ASN1CSeqOfListIterator::next (  ) 

This method returns the next element in the list.

This method may be called repeatedly to iterate through the list or intermixed with calls to prev to go back and forth.

Returns:
The next element in the list. A null value will be returned if the iteration is not successful.
EXTRTMETHOD void* ASN1CSeqOfListIterator::prev (  ) 

This method returns the previous element in the list.

This method may be called repeatedly to iterate through the list or intermixed with calls to next to go back and forth.

Parameters:
- none
Returns:
The previous element in the list. A null value will be returned if the iteration is not successful.
EXTRTMETHOD int ASN1CSeqOfListIterator::remove (  ) 

This method removes from the list the last element that was returned by the next or prev methods.

This call can only be made once per call to the next or prev methods.

Parameters:
- none
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
EXTRTMETHOD int ASN1CSeqOfListIterator::set ( void *  data  ) 

This method replaces the last element returned by the next or prev methods with the specified element.

This call can be made only if neither remove nor insert methods have been called after the last call to next or prev methods.

Parameters:
data The element that replaces the last element returned by the next or prev methods
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

The documentation for this class was generated from the following file: