zorba::Sequence

#include <zorba/xquery_functions.h>

Provides a way for a function to return a sequence of some type T that can be iterated over.

Parameters

T The type of sequence.

Public Types

T

value_type

Private Attributes

std::unique_ptr< iterator >

i_

Public Functions

bool

next(value_type *result)

Gets the next element in the sequence.

Sequence(iterator *i)

Constructs a new Sequence.

Sequence(Sequence const &s)

Copy constructs a Sequence.

Private Functions

Sequence &

operator=(Sequence const &)

Public Types

value_type

T value_type

Private Attributes

Public Functions

next

bool next(value_type *result)

Gets the next element in the sequence.

Parameters

result A pointer to the variable to receive the next element.

Returns

true only if there is a next element.

Sequence

 Sequence(iterator *i)

Constructs a new Sequence.

This constructor is intended only for function implementors.

Parameters

i The iterator that provides the elements of the sequence. Ownership of the iterator is taken.

Sequence

 Sequence(Sequence const &s)

Copy constructs a Sequence.

Parameters

s The Sequence to copy from. Note that it is a destructive copy in that the sequence of s is 'i' moved.

Private Functions

operator=

Sequence & operator=(Sequence const &)