HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
rwsf::Enumeration< T > Class Template Reference

Provides an interface for iterating over any RWSF container type implementations. More...

#include <rwsf/core/Enumeration.h>

Inheritance diagram for rwsf::Enumeration< T >:
rwsf::HandleBase

Public Member Functions

 Enumeration ()
 
 Enumeration (const Enumeration< T > &rhs)
 
virtual ~Enumeration ()
 
bool hasMoreElements () const
 
nextElement ()
 
Enumeration< T > & operator= (const Enumeration< T > &rhs)
 
- Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
 
bool operator!= (const HandleBase &second) const
 
bool operator== (const HandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
virtual ~HandleBase (void)
 
BodyBase & body (void) const
 
HandleBaseoperator= (const HandleBase &second)
 

Detailed Description

template<class T>
class rwsf::Enumeration< T >

rwsf::Enumeration holds a sequence of values of type T. The class provides a convenient interface for iterating over a variety of different container type implementations. All RWSF container implementations can be accessed through the rwsf::Enumeration interface.

Basic usage example:

Enumeration<std::string> namingBindings =
while (namingBindings.hasMoreElements()) {
std::string bindingName = namingBindings.nextElement();
...
}

Constructor & Destructor Documentation

template<class T>
rwsf::Enumeration< T >::Enumeration ( )

Creates an empty enumeration. Use the copy constructor to create a valid enumeration.

template<class T>
rwsf::Enumeration< T >::Enumeration ( const Enumeration< T > &  rhs)

Copy constructor. Attaches to and increments the reference count on the body instance of rhs.

template<class T>
virtual rwsf::Enumeration< T >::~Enumeration ( )
virtual

Detaches from the current body (if any), decrements its reference count, and deletes it if there are no other references.

Member Function Documentation

template<class T>
bool rwsf::Enumeration< T >::hasMoreElements ( ) const

Returns true if there are more elements in this enumeration, otherwise returns false.

template<class T>
T rwsf::Enumeration< T >::nextElement ( )

Returns the next element if there are more elements, otherwise throws an rwsf::OutOfBoundsException("Invalid usage") exception.

template<class T>
Enumeration<T>& rwsf::Enumeration< T >::operator= ( const Enumeration< T > &  rhs)

Assignment operator.

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.