ASN1C C/C++ Common Runtime
ASN1C v7.3.x
|
#include <ASN1CSeqOfList.h>
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 | |
ASN1CSeqOfList * | pSeqList |
OSRTDListNode * | nextNode |
OSRTDListNode * | lastNode |
volatile int | expectedModCount |
int | stat |
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.
|
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.
|
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.
References ASN1CSeqOfList::insert().
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.
data | The element to be inserted |
Referenced by ASN1CSeqOfList::init().
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.
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.
- | none |
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.
- | none |
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.
data | The element that replaces the last element returned by the next or prev methods |