WRT::IIterable Class Reference

#include <mw/cwrt/iterable.h>

class WRT::IIterable
Public Member Functions
pure virtual voidclose()
pure virtual boolhasNext()
pure virtual QVariant next()
pure virtual voidreset()

Detailed Description

Interface class for iterable interface implemented by service provider.

Note, when service provider implments this interface, it must derive from this interface and QObject. e.g. CMyCollection : public QObject, public IIterable { public: CMyCollection(); .... }

Member Function Documentation

close ( )

voidclose()[pure virtual]

Free resources in the collection The service provider should provide a concrete implementation for this method.

hasNext ( )

boolhasNext()[pure virtual]

Check if there is next item available

The service provider should provide a concrete implementation for this method.

Return Value
false if there are no more data elements to be fetched; true otherwise

next ( )

QVariant next()[pure virtual]

Get current item in the collection and get ready for next item.

The service provider should provide a concrete implementation for this method.

Return Value
current data entry

reset ( )

voidreset()[pure virtual]

Resets the iterator

The service provider should provide a concrete implementation to reset the iterator.