#include <storage/GenericIterable.h>
Inheritance diagram for BGenericIterable:
This class takes care of the construction of iterators and their management. Derived classes will need to create their own subclass of the GenericIterator class found here, and implement NewGenericIterator() to return new instances of that class.
Some additional subclasses provide for specific and convenient implementations, such as BIndexedIterable for an iterable over an array-like structure. Note that BGenericIterable by itself only provides iterators that implement the raw IIterator interface -- a full IRandomIterator can not be provided here.
Iterator Management | |
Helpers for dealing with active iterator objects. | |
typedef bool(* | for_each_iterator_func )(const sptr< BGenericIterable > &iterable, const sptr< GenericIterator > &iterator, void *cookie) |
Call-back function for ForEachIteratorLocked(). | |
void | ForEachIteratorLocked (for_each_iterator_func func, void *cookie) |
This will call func for each iterator that currently exists. | |
void | PushIteratorChangedLocked () |
Push the IteratorChanged event for all active iterators. | |
Bookkeeping | |
Creation, destruction, locking, etc. | |
BGenericIterable (const SContext &context) | |
BGenericIterable () | |
virtual lock_status_t | Lock () const |
Lock the iterable's state. | |
virtual void | Unlock () const |
Unlock the node's state. | |
virtual | ~BGenericIterable () |
New Generic Iterable Virtuals | |
Subclasses must override NextIteratorEntryLocked() to supply the remaining iterable implementation, and can use the others to customize its behavior. | |
virtual sptr< GenericIterator > | NewGenericIterator (const SValue &args)=0 |
Create and return a new iterator object. | |
INode Interface | |
Generic implementation of the INode interface. | |
virtual sptr< IIterator > | NewIterator (const SValue &args=B_UNDEFINED_VALUE, status_t *error=NULL) |
Returns a new iterator by calling NewGenericIterator(). | |
Friends | |
class | GenericIterator |
Classes | |
class | GenericIterator |
Generic base class implementation of a BGenericIterable's iterator. More... |
|
Call-back function for ForEachIteratorLocked().
|
|
|
|
|
|
|
|
This will call func for each iterator that currently exists.
|
|
Lock the iterable's state. To keep itself consistent, this class provides a public lock that is used when doing read/write operations on the class state as well as the actual data. The default implemention of this method acquires an internal lock. You can override it to cause all internal implementation to acquire some other lock. Be sure to also override Unlock() if doing so. Reimplemented in BSchemaRowIDJoin, BSchemaRowIDJoin::RowNode, BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BIndexedDataNode, BIndexedTableNode, BIndexedTableNode::RowNode, BIndexedCatalog, and BCatalog. |
|
Create and return a new iterator object. Derived classes need to implement this to return their own GenericIterator subclass. Implemented in BSchemaRowIDJoin, BSchemaTableNode, BCatalogDelegate, and BIndexedIterable. |
|
Returns a new iterator by calling NewGenericIterator(). Subclasses should not override this method, using NewGenericIterator() instead. Implements IIterable. |
|
Push the IteratorChanged event for all active iterators.
|
|
Unlock the node's state.
Reimplemented in BSchemaRowIDJoin, BSchemaRowIDJoin::RowNode, BSchemaTableNode, BSchemaTableNode::RowNode, BCatalogDelegate, BIndexedDataNode, BIndexedTableNode, BIndexedTableNode::RowNode, BIndexedCatalog, and BCatalog. |
|
|