DigitalSpaces::DIObjectBaseList1 Struct Reference
[Lists]

#include <ContainerInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Detailed Description

A collection of unknown interfaces, that can be iterated through.

The implementation needs to keep an internal state, of which of its entries is "current".

This collection interface is used when a function will be providing a list of objects. Rather then have a interface declaration for a unique type of list for each type of object being returned, we use a list of the common base interface, which can be dss_cast or QueryInterface to the desired interface.


Public Member Functions

void Restart ()
 Resets "current" to the first item.
DIObjectBase *const GetCurrent ()
 Gets the "current" entry.
bool Advance ()
 Advances "current".
bool AtEnd ()
 Check if "current" is past the end of the list.
unsigned int Size ()
 Returns the length of the list.
DIObjectBase *const GetCurrentAndAdvance ()
 Calls GetCurrent then Advance, returning the value from GetCurrent.
bool Empty ()
 Check if the list is empty.
void PushBack (DIObjectBase *)
 Appends an object to the list.
void Clear ()
 Removes all items from the list.

Member Function Documentation

void DigitalSpaces::DIObjectBaseList1::Restart (  ) 

Resets "current" to the first item.

DIObjectBase* const DigitalSpaces::DIObjectBaseList1::GetCurrent (  ) 

Gets the "current" entry.

bool DigitalSpaces::DIObjectBaseList1::Advance (  ) 

Advances "current".

Returns:
False if at the end of the list. In this case, the result from GetCurrent is undefined.

bool DigitalSpaces::DIObjectBaseList1::AtEnd (  ) 

Check if "current" is past the end of the list.

This will be the same as checking if Advance has returned false. If true, GetCurrent returns undefined answers.

Returns:
True if at the end of the list, false if not.

unsigned int DigitalSpaces::DIObjectBaseList1::Size (  ) 

Returns the length of the list.

DIObjectBase* const DigitalSpaces::DIObjectBaseList1::GetCurrentAndAdvance (  ) 

Calls GetCurrent then Advance, returning the value from GetCurrent.

This is a convenience function.

bool DigitalSpaces::DIObjectBaseList1::Empty (  ) 

Check if the list is empty.

Depending on the implementation, this may be faster then calling Size and comparing to zero, particularly in cases where the list is not empty.

void DigitalSpaces::DIObjectBaseList1::PushBack ( DIObjectBase  ) 

Appends an object to the list.

void DigitalSpaces::DIObjectBaseList1::Clear (  ) 

Removes all items from the list.


The documentation for this struct was generated from the following file:

Generated on Sun Aug 31 17:46:28 2008 for Digital Spaces by  doxygen 1.5.6