CarobNS::AbstractControllerPool Class Reference

Abstract class over each policy implementation, which is used by the driver to choose a controller to connect to. More...

#include <ControllerPool.hpp>

Inheritance diagram for CarobNS::AbstractControllerPool:

CarobNS::RoundRobinControllerPool List of all members.

Public Member Functions

 AbstractControllerPool (const std::vector< ControllerInfo > &controllerList, long retryIntervalInMs=0) throw (DriverException, UnexpectedException)
 Creates a new AbstractControllerPool object.
virtual ~AbstractControllerPool ()
 Clears list of controllers.
virtual ControllerInfo getController ()=0 throw (NoMoreControllerException, UnexpectedException)
 Gets a controller using the implementation specific policy.
void addRef ()
 Tells the pool that a new connection is using it.
int removeRef ()
 Tells the pool that one of its 'user' (ie.
 operator std::wstring () const
 Display useful info in a string.

Protected Attributes

std::vector< ControllerInfocontroller_list
 list of valid controllers
CriticalSection pool_CS
 class-wide mutex

Detailed Description

Abstract class over each policy implementation, which is used by the driver to choose a controller to connect to.


Constructor & Destructor Documentation

CarobNS::AbstractControllerPool::AbstractControllerPool ( const std::vector< ControllerInfo > &  controllerList,
long  retryIntervalInMs = 0 
) throw (DriverException, UnexpectedException)

Creates a new AbstractControllerPool object.

Parameters:
controllerList the controller list on which the policy applies
retryIntervalInMs IGNORED ! interval in milliseconds before retrying to re-connect to a controller that has failed


Member Function Documentation

virtual ControllerInfo CarobNS::AbstractControllerPool::getController (  )  throw (NoMoreControllerException, UnexpectedException) [pure virtual]

Gets a controller using the implementation specific policy.

Returns:
ControllerInfo of the selected controller
Exceptions:
NoMoreControllerException if no controller in the controller list is reachable

Implemented in CarobNS::RoundRobinControllerPool.

int CarobNS::AbstractControllerPool::removeRef (  )  [inline]

Tells the pool that one of its 'user' (ie.

connection) doesn't use it anymore, and return the new number of references


The documentation for this class was generated from the following file:
Generated on Tue Oct 24 09:05:38 2006 for Carob by  doxygen 1.5.0