DigitalSpaces::DIStringList1Impl Class Reference
[Lists]

#include <ContainerImplementations.h>

Inherits DigitalSpaces::DIStringList1.


Detailed Description

Implements DIStringList1.

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


Public Member Functions

 DIStringList1Impl ()
 Default constructor.
 DIStringList1Impl (const std::list< std::string > &)
 Construct the object, copying the items from the provided STL list.
 DIStringList1Impl (const DIStringList1Impl &)
 Copy constructor.
virtual ~DIStringList1Impl ()
 Generic destructor.
std::list< std::string > & GetList ()
 Returns a direct reference to the implementations collection.
Class preparation functions.
These are used to append objects to the implementations list.

void AddItem (const char *)
 Add specified string to the end of the contained list.
void AddItem (const std::string &)
 Add specified string to the end of the contained list.
Interface Functions
These functions are those required by DIStringList1

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

Static Public Member Functions

static std::list< std::string > Convert (DIStringList1 *)
 Helpful conversion function for DIStringList1 to std::list<std::string>.

Protected Attributes

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

Constructor & Destructor Documentation

DigitalSpaces::DIStringList1Impl::DIStringList1Impl (  ) 

Default constructor.

Initializes and empty list.

DigitalSpaces::DIStringList1Impl::DIStringList1Impl ( const std::list< std::string > &   ) 

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

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

DigitalSpaces::DIStringList1Impl::DIStringList1Impl ( const DIStringList1Impl  ) 

Copy constructor.

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

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

Generic destructor.


Member Function Documentation

void DigitalSpaces::DIStringList1Impl::AddItem ( const char *   ) 

Add specified string to the end of the contained list.

void DigitalSpaces::DIStringList1Impl::AddItem ( const std::string &   ) 

Add specified string to the end of the contained list.

void DigitalSpaces::DIStringList1Impl::Restart (  ) 

Resets "current" to the first item.

Reimplemented from DigitalSpaces::DIStringList1.

const char* DigitalSpaces::DIStringList1Impl::GetCurrent (  ) 

Gets the "current" entry.

Reimplemented from DigitalSpaces::DIStringList1.

bool DigitalSpaces::DIStringList1Impl::Advance (  ) 

Advances "current".

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

Reimplemented from DigitalSpaces::DIStringList1.

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

unsigned int DigitalSpaces::DIStringList1Impl::Size (  ) 

Returns the length of the list.

Reimplemented from DigitalSpaces::DIStringList1.

const char* DigitalSpaces::DIStringList1Impl::GetCurrentAndAdvance (  ) 

Calls GetCurrent then Advance, returning the value from GetCurrent.

This is a convenience function.

Reimplemented from DigitalSpaces::DIStringList1.

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

void DigitalSpaces::DIStringList1Impl::PushBack ( const char *   ) 

Appends a string to the list.

Reimplemented from DigitalSpaces::DIStringList1.

void DigitalSpaces::DIStringList1Impl::Clear (  ) 

Removes all items from the list.

Reimplemented from DigitalSpaces::DIStringList1.

std::list<std::string>& DigitalSpaces::DIStringList1Impl::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.

static std::list<std::string> DigitalSpaces::DIStringList1Impl::Convert ( DIStringList1  )  [static]

Helpful conversion function for DIStringList1 to std::list<std::string>.

See DIStringList1Impl( const std::list<std::string>& ) for conversion in other direction


Field Documentation

std::list<std::string >::iterator DigitalSpaces::DIStringList1Impl::m_iterator [protected]

Storage for "current".

std::list<std::string > DigitalSpaces::DIStringList1Impl::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