#include <storage/GenericIterable.h>
Inheritance diagram for BGenericIterable::GenericIterator:
You will need to create your own concete subclass.
IIterator/IRandomIterator interfaces. | |
This is a generic implementation of the iterator interface. Some of these have new virtuals on this class that you should override instead of the base virtuals here. | |
virtual size_t | Count () const |
This base class does not support IRandomIterator, so this is stubbed to return 0. | |
virtual status_t | Next (IIterator::ValueList *keys, IIterator::ValueList *values, uint32_t flags, size_t count) |
Fills in the vectors by calling back to BGenericIterable::NextIteratorEntryLocked(). | |
virtual SValue | Options () const |
Return the argument options that are in effect for this iterator. | |
virtual size_t | Position () const |
This base class does not support IRandomIterator, so this is stubbed to return 0. | |
virtual status_t | Remove () |
Calls back to BGenericIterable::RemoveIteratorEntryLocked(). | |
virtual void | SetPosition (size_t p) |
This base class does not support IRandomIterator, so this is stubbed to do nothing. | |
SSQLBuilder Redirection | |
Redirect our SSQLBuilder virtuals up to the BGenericIterable class, so subclasses can modify the iterable's behavior from there. | |
virtual SValue | CreateSQLFilter (const SValue &filter) const |
Call back to BGenericIterable::CreateSQLFilter(). | |
virtual void | MapSQLColumn (SValue *inoutColumn) const |
Call back to BGenericIterable::MapSQLColumn(). | |
virtual void | MapSQLOrderColumn (SValue *inoutColumnName, SValue *inoutOrder) const |
Call back to BGenericIterable::MapSQLOrderColumn(). | |
Bookkeeping | |
Creation, destruction, locking, etc. | |
GenericIterator (const SContext &context, const sptr< BGenericIterable > &owner) | |
virtual SValue | Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags) |
Override to only return the IIterator interface. | |
const sptr< BGenericIterable > & | Owner () const |
Return the BGenericIterable that created this iterator. | |
virtual status_t | StatusCheck () const |
Use to return an error back to NewIterator(). The default implementation always returns B_OK. | |
virtual status_t | FinishAtom (const void *id) |
The destructor must call Lock(), so return FINISH_ATOM_ASYNC to avoid deadlocks. | |
virtual void | InitAtom () |
Adds the iterator to its BGenericIterable. | |
virtual | ~GenericIterator () |
New Functionality | |
Virtuals you need to override to complete the iterator implementation, virtuals you can override to customize it, and helper functions. | |
virtual status_t | NextLocked (uint32_t flags, SValue *key, SValue *entry)=0 |
Move iterator to next item and return it. The 'flags' come directly from IIterator::Next(). | |
virtual status_t | ParseArgs (const SValue &args) |
Process arguments passed to NewIterator(). | |
virtual status_t | RemoveLocked () |
Remove the current item from the iterable. |
|
|
|
|
|
This base class does not support IRandomIterator, so this is stubbed to return 0.
Implements IRandomIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Call back to BGenericIterable::CreateSQLFilter().
Reimplemented from SSQLBuilder. Reimplemented in BSchemaTableNode::QueryIterator. |
|
The destructor must call Lock(), so return FINISH_ATOM_ASYNC to avoid deadlocks.
Reimplemented from SAtom. Reimplemented in BSchemaRowIDJoin::JoinIterator, and BSchemaTableNode::QueryIterator. |
|
Adds the iterator to its BGenericIterable.
Reimplemented from SAtom. Reimplemented in BSchemaTableNode::QueryIterator. |
|
Override to only return the IIterator interface. A GenericIterator does not have a position, so it can only support the IIterator interface. If your subclass of GenericIterator wants to also support IRandomIterator, you should re-implement this function to directly call BnRandomIterator::Inspect(). Reimplemented from BnRandomIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Call back to BGenericIterable::MapSQLColumn().
Reimplemented from SSQLBuilder. |
|
Call back to BGenericIterable::MapSQLOrderColumn().
Reimplemented from SSQLBuilder. |
|
Fills in the vectors by calling back to BGenericIterable::NextIteratorEntryLocked().
Implements IIterator. Reimplemented in BCatalogDelegate::IteratorDelegate. |
|
Move iterator to next item and return it. The 'flags' come directly from IIterator::Next().
Implemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Return the argument options that are in effect for this iterator. The default implementation returns B_UNDEFINED, indicating no additional arguments have been handled. Derived implementations should always try to implement this option; if you can't, re-implement this function to return only the options you do implement. Implements IIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Return the BGenericIterable that created this iterator.
|
|
Process arguments passed to NewIterator(). The default implementation does nothing. Derived implementation should try to handle as many arguments as possible, returning those from Options(). Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
This base class does not support IRandomIterator, so this is stubbed to return 0.
Implements IRandomIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Calls back to BGenericIterable::RemoveIteratorEntryLocked().
Implements IRandomIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, and BCatalogDelegate::IteratorDelegate. |
|
Remove the current item from the iterable. The default implementation returns B_UNSUPPORTED. Reimplemented in BIndexedIterable::IndexedIterator. |
|
This base class does not support IRandomIterator, so this is stubbed to do nothing.
Implements IRandomIterator. Reimplemented in BSchemaRowIDJoin::JoinIterator, BSchemaTableNode::QueryIterator, BCatalogDelegate::IteratorDelegate, and BIndexedIterable::IndexedIterator. |
|
Use to return an error back to NewIterator(). The default implementation always returns B_OK.
Reimplemented in BCatalogDelegate::IteratorDelegate. |