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

An STL compatible Iterator implementation. More...

#include <SearchResultSet.hpp>

Public Member Functions

MLCLIENT_API SearchResultSetIterator ()
 Default constructor.
 
MLCLIENT_API SearchResultSetIterator (SearchResultSet *set)
 Creates an iterator over the specified result set. More...
 
MLCLIENT_API SearchResultSetIterator (SearchResultSet *set, long pos)
 Creates an iterator over the specified result set. More...
 
MLCLIENT_API SearchResultSetIteratorbegin ()
 Returns the iterator start instance. More...
 
MLCLIENT_API SearchResultSetIteratorend ()
 Returns the iterator end instance. More...
 
MLCLIENT_API bool operator== (const SearchResultSetIterator &other)
 Equality operator for comparing an iterator instance to end() More...
 
MLCLIENT_API bool operator!= (const SearchResultSetIterator &other)
 Inequality operator for comparing an iterator instance to end() More...
 
MLCLIENT_API void operator++ ()
 The iterator increment operator.
 
MLCLIENT_API const SearchResult operator* ()
 The dereference operator, which returns the SearchResult at the current position in the SearchResultSet.
 
MLCLIENT_API SearchResultSetIterator operator= (const SearchResultSetIterator &other)
 Copy assignment operator. More...
 
MLCLIENT_API const SearchResultfirst () const
 Returns the first result in the result set. More...
 

Detailed Description

An STL compatible Iterator implementation.

Warning
Currently this isn't quite compatible - 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 SearchResultSetTest class for a sample use under release/test

Since
8.0.2

Constructor & Destructor Documentation

MLCLIENT_API mlclient::SearchResultSetIterator::SearchResultSetIterator ( SearchResultSet set)

Creates an iterator over the specified result set.

Note
This class does NOT own (i.e. delete) the provided SearchResultSet instance
Parameters
setThe SearchResultSet to iterator over, starting with the first result
MLCLIENT_API mlclient::SearchResultSetIterator::SearchResultSetIterator ( SearchResultSet set,
long  pos 
)

Creates an iterator over the specified result set.

Note
This class does NOT own (i.e. delete) the provided SearchResultSet instance
Parameters
setThe SearchResultSet to iterator over, starting with the pos-th result

Member Function Documentation

MLCLIENT_API SearchResultSetIterator* mlclient::SearchResultSetIterator::begin ( )

Returns the iterator start instance.

Returns
The iterator over this set
MLCLIENT_API SearchResultSetIterator* mlclient::SearchResultSetIterator::end ( )

Returns the iterator end instance.

Returns
The end of iterator marker
MLCLIENT_API const SearchResult& mlclient::SearchResultSetIterator::first ( ) const

Returns the first result in the result set.

Returns
The first search result
MLCLIENT_API bool mlclient::SearchResultSetIterator::operator!= ( const SearchResultSetIterator other)

Inequality operator for comparing an iterator instance to end()

Parameters
otherThe other iterator instance to compare this instance against
MLCLIENT_API SearchResultSetIterator mlclient::SearchResultSetIterator::operator= ( const SearchResultSetIterator other)

Copy assignment operator.

Parameters
otherThe other iterator to copy state from
MLCLIENT_API bool mlclient::SearchResultSetIterator::operator== ( const SearchResultSetIterator other)

Equality operator for comparing an iterator instance to end()

Parameters
otherThe other iterator instance to compare this instance against

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