HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
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 (BodyBase *body)
 HandleBase (const HandleBase &second)
 HandleBase (StaticCtor)
 HandleBase (void)
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();
}
bool hasMoreElements() const
rwsf::Enumeration< std::string > listBindings() const
static NamingContext * getGlobalInstance()

Constructor & Destructor Documentation

◆ Enumeration() [1/2]

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

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

◆ Enumeration() [2/2]

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.

◆ ~Enumeration()

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

◆ hasMoreElements()

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

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

◆ nextElement()

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.

◆ operator=()

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

Assignment operator.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.