#include <support/IIterator.h>
Inheritance diagram for IIterator:
An IIterator allows you to step through some series of data. It is a stateful object (the iterator holds a position in the data), so you must be careful if you share iterators between threads. You usually retrieve an IIterator object from IIterable::NewIterator().
Clients will usually use the SIterator convenience class instead of making direct calls on an IIterator. Implementations should never directly implement IIterable, instead using BGenericIterable or one of its subclasses.
This is the minimal system data iteration interface. Note that there is no Reset() or Rewind() method on this interface; for non-streaming access, see IRandomIterator.
Public Types | |
enum | { BINDER_IPC_LIMIT = 0x05 } |
enum | { REQUEST_DATA = 0x1000, COLLAPSE_NODE = 0x2000, COLLAPSE_CATALOG = 0x2000, IGNORE_PROJECTION = 0x4000 } |
Flags used in Next() and other iterator functions as well. More... | |
typedef SVector< SValue > | ValueList |
Public Member Functions | |
status_t | LinkIterator (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0) |
virtual status_t | Next (ValueList *keys, ValueList *values, uint32_t flags, size_t count=0)=0 |
Return a batch of keys and values from the iteration. | |
virtual SValue | Options () const =0 |
The iterable options that are in force for this iterator. | |
status_t | UnlinkIterator (const sptr< IBinder > &to, const SValue &mappings, uint32_t flags=0) |
Protected Member Functions | |
IIterator () | |
virtual | ~IIterator () |
|
|
|
|
|
Flags used in Next() and other iterator functions as well. The implementation of all these flags is optional. However, if your iterator does implement projections, then it must also implement IGNORE_PROJECTION. Otherwise implementations of IIterator can completely ignore these flags. There is a copy of these flags in INode, if you change these don't forget to change those as well.
|
|
|
|
|
|
|
|
Return a batch of keys and values from the iteration.
The iterator may return key/value pairs, or single values. If returning single values, by the SValue mapping rules the key should always be B_WILD_VALUE. The Next() method can be given a flags parameter. Like INode::Walk(), you can supply REQUEST_DATA and COLLAPSE_NODE in the function's flags, with the corresponding semantics for the values the iterator returns. Also like INode::Walk(), the iterator is free to ignore these flags. Implemented in BCatalogDelegate::IteratorDelegate, BGenericIterable::GenericIterator, BValueIterator, and BRandomIterator. |
|
The iterable options that are in force for this iterator. You can use this determine which of the arguments given to IIterable::NewIterator() are in force for this iterator, and in what way. These are the same form as the arguments supplied to IIterable::NewIterator(). Implemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, BGenericIterable::GenericIterator, BIndexedIterable::IndexedIterator, BValueIterator, and BRandomIterator. |
|
|