HandleManager Class Template Reference

Manage a set of handles ('provide' and 'free' services). More...

#include <HandleManager.hh>

List of all members.

Public Member Functions

 HandleManager (T)
 Constructor with init value.
 HandleManager (T init, size_t hmax)
 Constructor with init value and max.
provide () throw (RTIinternalError)
 Get a new handle.
void free (T handle)
 Free a handle.

Private Attributes

size_t maximum
highest
std::list< T > available


Detailed Description

template<typename T>
class certi::HandleManager< T >

Manage a set of handles ('provide' and 'free' services).

Freed handles may be provided again in a future request.

Definition at line 43 of file HandleManager.hh.


Constructor & Destructor Documentation

HandleManager ( init  )  [inline]

Constructor with init value.

The default maximal value will be based on the type max given by numeric_limits traits.

Parameters:
[in] init Initial handle value (use for first requested handle)

Definition at line 81 of file HandleManager.hh.

HandleManager ( init,
size_t  hmax 
) [inline]

Constructor with init value and max.

Parameters:
[in] init Initial handle value (use for first requested handle)
[in] hmax Maximal handle value

Definition at line 85 of file HandleManager.hh.


Member Function Documentation

T provide (  )  throw (RTIinternalError) [inline]

Get a new handle.

Returns:
the new handle
Exceptions:
RTIinternalError if all handles between first and maximal are used

Definition at line 89 of file HandleManager.hh.

References HandleManager::available, HandleManager::highest, and HandleManager::maximum.

Referenced by RTIG::processCreateFederation().

void free ( handle  )  [inline]

Free a handle.

Precondition:
handle is a previously-provided handle
Parameters:
handle Handle to free
Todo:
CHECK how this could be handled, currently free does nothing!

Definition at line 108 of file HandleManager.hh.

Referenced by RTIG::processDestroyFederation().


Member Data Documentation

size_t maximum [private]

Definition at line 74 of file HandleManager.hh.

Referenced by HandleManager::provide().

T highest [private]

Definition at line 75 of file HandleManager.hh.

Referenced by HandleManager::provide().

std::list<T> available [private]

Definition at line 76 of file HandleManager.hh.

Referenced by HandleManager::provide().


The documentation for this class was generated from the following file:

Generated on Thu Apr 30 15:55:10 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5