BIndexedIterable::IndexedIterator Class Reference
[Data Model]

#include <storage/IndexedIterable.h>

Inheritance diagram for BIndexedIterable::IndexedIterator:

BGenericIterable::GenericIterator BnRandomIterator SSQLBuilder IRandomIterator BBinder IIterator IBinder IInterface SAtom SAtom List of all members.

Detailed Description

Iterator over an BIndexedIterable's data set.


IIterator/IRandomIterator interfaces.

virtual size_t Count () const
 Calls back to BIndexedIterable::CountEntriesLocked().
virtual SValue Options () const
 Add in BV_ITERABLE_SELECT and BV_ITERABLE_ORDER_BY arguments.
virtual size_t Position () const
 Returns the current iterator position.
virtual void SetPosition (size_t p)
 Changes the current iterator position.

Positions and Indices.

ssize_t CurrentIndexLocked () const
 Returns the iterator's current index in the iterable.
ssize_t MoveIndexLocked ()
 Moves the iterator forward by one and returns its previous index.
const SValue & SelectArgsLocked () const
 Return the select argument in effect for this iterator.

Bookkeeping

Creation, destruction, locking, etc.

 IndexedIterator (const SContext &context, const sptr< BGenericIterable > &owner)
virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags)
 This iterator supports for IIterator and IRandomIterator.
virtual ~IndexedIterator ()

GenericIterator.

virtual status_t NextLocked (uint32_t flags, SValue *key, SValue *entry)
 Implemented to call step the iterator and then call EntryAtLocked() with the previous index.
virtual status_t ParseArgs (const SValue &args)
 Parse out BV_ITERATOR_SELECT and BV_ITERABLE_ORDER_BY arguments.
virtual status_t RemoveLocked ()
 Implemented to call RemoveEntryAtLocked() with the current index.

Friends

class BIndexedIterable


Constructor & Destructor Documentation

IndexedIterator (  const SContext &  context,
const sptr< BGenericIterable > &  owner
) 
 

~IndexedIterator (   )  [protected, virtual]
 


Member Function Documentation

size_t Count (   )  const [virtual]
 

Calls back to BIndexedIterable::CountEntriesLocked().

Reimplemented from BGenericIterable::GenericIterator.

ssize_t CurrentIndexLocked (   )  const
 

Returns the iterator's current index in the iterable.

This is different than Position() -- it is the actual index in the physical data, after the sort order has been applied. Note that the returned index can be B_END_OF_DATA if we have reached the end of the iterator, or B_ENTRY_NOT_FOUND if this item in the iterator has been deleted from the iterable.

SValue Inspect (  const sptr< IBinder > &  caller,
const SValue &  which,
uint32_t  flags
)  [virtual]
 

This iterator supports for IIterator and IRandomIterator.

Reimplemented from BGenericIterable::GenericIterator.

ssize_t MoveIndexLocked (   ) 
 

Moves the iterator forward by one and returns its previous index.

This is equivalent to calling CurrentIndexLocked(), and then SetPosition(Position()+1).

status_t NextLocked (  uint32_t  flags,
SValue *  key,
SValue *  entry
)  [virtual]
 

Implemented to call step the iterator and then call EntryAtLocked() with the previous index.

Implements BGenericIterable::GenericIterator.

SValue Options (   )  const [virtual]
 

Add in BV_ITERABLE_SELECT and BV_ITERABLE_ORDER_BY arguments.

If the subclass has implemented CreateSortOrderLocked() to support sorting, this function will add that data in to GenericIterable::Options().

Reimplemented from BGenericIterable::GenericIterator.

status_t ParseArgs (  const SValue &  args  )  [virtual]
 

Parse out BV_ITERATOR_SELECT and BV_ITERABLE_ORDER_BY arguments.

Calls CreateSelectionLocked() to allow subclasses to implement project and CreateSortOrderLocked() to allow subclasses to implement sorting.

Reimplemented from BGenericIterable::GenericIterator.

size_t Position (   )  const [virtual]
 

Returns the current iterator position.

Reimplemented from BGenericIterable::GenericIterator.

status_t RemoveLocked (   )  [virtual]
 

Implemented to call RemoveEntryAtLocked() with the current index.

Reimplemented from BGenericIterable::GenericIterator.

const SValue& SelectArgsLocked (   )  const [inline]
 

Return the select argument in effect for this iterator.

B_UNDEFINED_VALUE means to return all items.

void SetPosition (  size_t  p  )  [virtual]
 

Changes the current iterator position.

Reimplemented from BGenericIterable::GenericIterator.


Friends And Related Function Documentation

friend class BIndexedIterable [friend]
 


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