DigitalSpaces::DIDUIDList1Impl Class Reference
[Lists]

#include <ContainerImplementations.h>

Inherits DigitalSpaces::DIDUIDList1.


Detailed Description

Implements DISUIDList1, a list of DUID's.

We cant use DIList1 here because its not a list of interfaces.


Public Member Functions

 DIDUIDList1Impl ()
 Default constructor.
 DIDUIDList1Impl (const std::list< const DUID * > &)
 Construct the object, copying the items from the provided STL list.
 DIDUIDList1Impl (const DIDUIDList1Impl &)
 Copy constructor.
virtual ~DIDUIDList1Impl ()
 Generic destructor.
void AddItem (const DUID *)
 Add specified string to the end of the contained list.
std::list< const DUID * > & GetList ()
 Returns a direct reference to the implementations collection.
Interface Functions
These functions are those required by DIDUIDList1

void Restart ()
 Resets "current" to the first item.
const DUIDGetCurrent ()
 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.
const DUIDGetCurrentAndAdvance ()
 Calls GetCurrent then Advance, returning the value from GetCurrent.
bool Empty ()
 Check if the list is empty.
void PushBack (const DUID *)
 Appends an ID to the list.
void Clear ()
 Removes all items from the list.

Protected Attributes

std::list< const DUID * >::iterator m_iterator
 Storage for "current".
std::list< const DUID * > m_list
 The collection this implementation is wrapping.

Constructor & Destructor Documentation

DigitalSpaces::DIDUIDList1Impl::DIDUIDList1Impl (  ) 

Default constructor.

Initializes and empty list.

DigitalSpaces::DIDUIDList1Impl::DIDUIDList1Impl ( const std::list< const DUID * > &   ) 

Construct the object, copying the items from the provided STL list.

"Current" will be set to the start of the new list.

DigitalSpaces::DIDUIDList1Impl::DIDUIDList1Impl ( const DIDUIDList1Impl  ) 

Copy constructor.

Copys the list contents, however it puts "Current" at the beginning of the copied list.

virtual DigitalSpaces::DIDUIDList1Impl::~DIDUIDList1Impl (  )  [virtual]

Generic destructor.


Member Function Documentation

void DigitalSpaces::DIDUIDList1Impl::AddItem ( const DUID  ) 

Add specified string to the end of the contained list.

void DigitalSpaces::DIDUIDList1Impl::Restart (  ) 

Resets "current" to the first item.

Reimplemented from DigitalSpaces::DIDUIDList1.

const DUID* DigitalSpaces::DIDUIDList1Impl::GetCurrent (  ) 

Gets the "current" entry.

Reimplemented from DigitalSpaces::DIDUIDList1.

bool DigitalSpaces::DIDUIDList1Impl::Advance (  ) 

Advances "current".

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

Reimplemented from DigitalSpaces::DIDUIDList1.

bool DigitalSpaces::DIDUIDList1Impl::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.

Reimplemented from DigitalSpaces::DIDUIDList1.

unsigned int DigitalSpaces::DIDUIDList1Impl::Size (  ) 

Returns the length of the list.

Reimplemented from DigitalSpaces::DIDUIDList1.

const DUID* DigitalSpaces::DIDUIDList1Impl::GetCurrentAndAdvance (  ) 

Calls GetCurrent then Advance, returning the value from GetCurrent.

This is a convenience function.

Reimplemented from DigitalSpaces::DIDUIDList1.

bool DigitalSpaces::DIDUIDList1Impl::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.

Reimplemented from DigitalSpaces::DIDUIDList1.

void DigitalSpaces::DIDUIDList1Impl::PushBack ( const DUID  ) 

Appends an ID to the list.

Reimplemented from DigitalSpaces::DIDUIDList1.

void DigitalSpaces::DIDUIDList1Impl::Clear (  ) 

Removes all items from the list.

Reimplemented from DigitalSpaces::DIDUIDList1.

std::list<const DUID*>& DigitalSpaces::DIDUIDList1Impl::GetList (  )  [inline]

Returns a direct reference to the implementations collection.

This allows you to use STL functions to work with the list, rather then the more unwieldy interface functions.

Note:
Because this a reference, modifying this list (adding, removing, changing the contained value) will alter the list contained by this object.


Field Documentation

std::list<const DUID* >::iterator DigitalSpaces::DIDUIDList1Impl::m_iterator [protected]

Storage for "current".

std::list<const DUID* > DigitalSpaces::DIDUIDList1Impl::m_list [protected]

The collection this implementation is wrapping.

Referenced by GetList().


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

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