Unicorn XML Toolkit
Version 1.00.00

Namespace Xpath
Class CIterator

class CIterator: public CInterface {
public:
    CIterator();
    virtual ~CIterator();
public:
    virtual XNodeSet GetNodeSet() = 0;
    virtual XNode GetNode() = 0;
    virtual int GetPosition() = 0;
    virtual void Iterate() = 0;
    };

The abstract interface to node-set iterators.

Node-set iterators are used for sequential enumeration of nodes in node-sets.

Every node-set iterator holds the internal ( 1 -based) position of the current node and the correspondig current node pointer. When the iterator is created, the current node position is initialized to 1 and the current node pointer points to the first node in the node-set if the node-set is not empty; otherwise, the current node position is initialized to 0 and the current node pointer is set to NULL .

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CNodeSet, Dom::INode
Constructor/Destructor Summary
CIterator ();
����������Constructs the node-set iterator.
~CIterator ();
����������Destroys the node-set iterator.

Function Summary
XNodeSet GetNodeSet ();
����������Returns the node-set associated with this iterator.
XNode GetNode ();
����������Returns the current node of this iterator.
int GetPosition ();
����������Returns the current node position of this iterator.
void Iterate ();
����������Advances the current node position.

Constructor/Destructor Detail

CIterator

CIterator();

Constructs the node-set iterator.

~CIterator

virtual ~CIterator();

Destroys the node-set iterator.

Function Detail

GetNodeSet

virtual XNodeSet GetNodeSet() = 0;

Returns the node-set associated with this iterator.

Returns:
the node-set associated with this iterator

GetNode

virtual XNode GetNode() = 0;

Returns the current node of this iterator.

Returns:
the current node of this iterator, or NULL if the end of node-set had been reached

GetPosition

virtual int GetPosition() = 0;

Returns the current node position of this iterator.

Returns:
the current node position ( 1 -based) of this iterator, or 0 if the end of node-set had been reached

Iterate

virtual void Iterate() = 0;

Advances the current node position.

If the end of node-set is reached, the current node position is set to 0 , and the current node pointer is set to NULL .


Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.