rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::Enumeration< T > Class Template Reference
[Core Containers]

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

List of all members.

Public Member Functions

 Enumeration ()
 Enumeration (const Enumeration< T > &rhs)
virtual ~Enumeration ()
Enumeration< T > & operator= (const Enumeration< T > &rhs)
bool hasMoreElements () const
nextElement ()

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 =
     rwsf::NamingContext::getGlobalInstance()->listBindings();

   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 © 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.