QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::ObjectIterator Struct Reference
[Object Iterators]

#include <Q/q.h>

Inheritance diagram for Q::ObjectIterator:

Q::ObjectBase List of all members.

Public Member Functions

 ObjectIterator ()
bool valid () const
Utils::Result next ()
void reset ()
Object current () const
Object operator * () const
ObjectIteratoroperator++ ()

Static Public Member Functions

ObjectIterator create (const Concept &type, const Database &db=Database())
ObjectIterator create (ClassType type, const Database &db=Database())
ClassType classType ()
ObjectIterator cast (const ObjectBase &obj)

Detailed Description

The ObjectIterator class is used to enumerate a list of objects. Various methods that would like to return a list of results do this by returning an ObjectIterator for that list.


Constructor & Destructor Documentation

Q::ObjectIterator::ObjectIterator  )  [inline]
 

Create a null object iterator reference.


Member Function Documentation

ObjectIterator Q::ObjectIterator::cast const ObjectBase obj  )  [static]
 

If the object referenced by obj is an object iterator, then return a suitable reference to the object.

ClassType Q::ObjectIterator::classType  )  [static]
 

Return the type for this class.

ObjectIterator Q::ObjectIterator::create ClassType  type,
const Database db = Database()
[static]
 

Create an object iterator which enumerates all the objects of a given type determined by the class type type. The optional db parameter restricts the search to a given database.

ObjectIterator Q::ObjectIterator::create const Concept type,
const Database db = Database()
[static]
 

Create an object iterator which enumerates all the objects of a given type determined by the concept type. The optional db parameter restricts the search to a given database.

If type is the null concept, then all API objects are enumerated.

Note:
this iteration is exhaustive and will cause all objects to be loaded into memory since a type index is not used.

Concepts are skipped.

Object Q::ObjectIterator::current  )  const
 

Return a handle to the object at the iterator's current position in the list.

Utils::Result Q::ObjectIterator::next  ) 
 

Advance the iterator to the next object in the list or if the current object is the last object in the list, then set the state of the iterator to invalid.

Object Q::ObjectIterator::operator *  )  const [inline]
 

See also:
current

ObjectIterator& Q::ObjectIterator::operator++  )  [inline]
 

See also:
next

void Q::ObjectIterator::reset  ) 
 

Set the iterator to point at the first object in the list.

bool Q::ObjectIterator::valid  )  const
 

Return true if the iterator's current position in the list of objects represents a valid object. When the iterator has finished iterating through the list, valid() will return false.

Reimplemented from Q::ObjectBase.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004