MarkLogic Connect
MarkLogic Connect Client API Collection
Public Member Functions | List of all members
mlclient::ValuesIterator Class Reference

Provides an STL compliant iterator implementation over a ValuesResultSet. More...

#include <ValuesResultSet.hpp>

Public Member Functions

MLCLIENT_API ValuesIterator ()
 Default Constructor.
 
MLCLIENT_API ValuesIterator (ValuesResultSet *set)
 Creates a ValuesIterator that wraps a result set, starting from the first result. More...
 
MLCLIENT_API ValuesIterator (ValuesResultSet *set, long pos)
 Creates a ValuesIterator that wraps a result set, starting from the specified position. More...
 
MLCLIENT_API ValuesIteratorbegin ()
 Returns the start iterator. More...
 
MLCLIENT_API ValuesIteratorend ()
 Returns the iterator end marker. More...
 
MLCLIENT_API bool operator== (const ValuesIterator &other)
 Whether this instance is the 'same' (same position value) as the other instance. More...
 
MLCLIENT_API bool operator!= (const ValuesIterator &other)
 Whether this instance is NOT the 'same' (same position value) as the other instance. More...
 
MLCLIENT_API void operator++ ()
 increments this iterator instance's position
 
MLCLIENT_API const ValuesResult operator* ()
 Returns a pointer to the ValuesResult at the current position in the set. More...
 
MLCLIENT_API ValuesIterator operator= (const ValuesIterator &other)
 copy assignment operator More...
 
MLCLIENT_API const ValuesResultfirst () const
 Returns the first ValuesResult in the result set. More...
 

Detailed Description

Provides an STL compliant iterator implementation over a ValuesResultSet.

Warning
Not quite STL compliant - it returns pointers rather than references. This should be fixed in 8.0.3. In particular in your loop you need to have this as your comparison: (*iter) != (*(myresultset::end())) and for the increment operator: ++(*iter)

See the ValuesResultSetTest class for a sample use under release/test

Since
8.0.2

Constructor & Destructor Documentation

MLCLIENT_API mlclient::ValuesIterator::ValuesIterator ( ValuesResultSet set)

Creates a ValuesIterator that wraps a result set, starting from the first result.

Parameters
setThe result set to wrap
MLCLIENT_API mlclient::ValuesIterator::ValuesIterator ( ValuesResultSet set,
long  pos 
)

Creates a ValuesIterator that wraps a result set, starting from the specified position.

Parameters
setThe result set to wrap
posThe position to start iterating from

Member Function Documentation

MLCLIENT_API ValuesIterator* mlclient::ValuesIterator::begin ( )

Returns the start iterator.

Returns
The starting point iterator
MLCLIENT_API ValuesIterator* mlclient::ValuesIterator::end ( )

Returns the iterator end marker.

Returns
The iterator end marker
MLCLIENT_API const ValuesResult& mlclient::ValuesIterator::first ( ) const

Returns the first ValuesResult in the result set.

Returns
The first values result in the result set
MLCLIENT_API bool mlclient::ValuesIterator::operator!= ( const ValuesIterator other)

Whether this instance is NOT the 'same' (same position value) as the other instance.

Parameters
otherThe ValuesIterator to compare this instance against
Returns
True if the iterators do not have the same position
MLCLIENT_API const ValuesResult mlclient::ValuesIterator::operator* ( )

Returns a pointer to the ValuesResult at the current position in the set.

Returns
The ValuesResult at this position
MLCLIENT_API ValuesIterator mlclient::ValuesIterator::operator= ( const ValuesIterator other)

copy assignment operator

Parameters
otherThe ValuesIterator to copy
Returns
The current ValuesIterator instance
MLCLIENT_API bool mlclient::ValuesIterator::operator== ( const ValuesIterator other)

Whether this instance is the 'same' (same position value) as the other instance.

Parameters
otherThe ValuesIterator to compare this instance against
Returns
True if the iterators have the same position

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