HydraExpress 4.6 |
HydraExpress C++ API Reference Guide |
|
Provides an interface for iterating over any RWSF container type implementations. More...
#include <rwsf/core/Enumeration.h>
Public Member Functions | |
Enumeration () | |
Enumeration (const Enumeration< T > &rhs) | |
virtual | ~Enumeration () |
Enumeration< T > & | operator= (const Enumeration< T > &rhs) |
bool | hasMoreElements () const |
T | nextElement () |
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 = rwsf::NamingContext::getGlobalInstance()->listBindings(); while (namingBindings.hasMoreElements()) { std::string bindingName = namingBindings.nextElement(); ... }
rwsf::Enumeration< T >::Enumeration | ( | ) |
Creates an empty enumeration. Use the copy constructor to create a valid enumeration.
rwsf::Enumeration< T >::Enumeration | ( | const Enumeration< T > & | rhs | ) |
Copy constructor. Attaches to and increments the reference count on the body instance of rhs.
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.
bool rwsf::Enumeration< T >::hasMoreElements | ( | ) | const |
Returns true
if there are more elements in this enumeration, otherwise returns false
.
T rwsf::Enumeration< T >::nextElement | ( | ) |
Returns the next element if there are more elements, otherwise throws an rwsf::OutOfBoundsException("Invalid usage") exception.
Enumeration<T>& rwsf::Enumeration< T >::operator= | ( | const Enumeration< T > & | rhs | ) |
Assignment operator.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.