CarobNS::ControllerPoolManager Class Reference

Holds a list of controller pools, that are indexed by their policy and list of controllers. More...

#include <ControllerPool.hpp>

List of all members.

Static Public Member Functions

static AbstractControllerPoolgetPool (std::vector< ControllerInfo > &ctrls, ConnectPolicy cp, int pingDelayInMs, int controllerTimeoutInMs) throw (DriverException, UnexpectedException)
 Returns a pool for the given pair controllers/policy.
static void freePool (AbstractControllerPool *pool)
 Decrements reference counter on the given pool.

Static Protected Member Functions

static void tryTocleanUpPools ()
 Walks through the pool map to look for pools that can be deleted, ie.


Detailed Description

Holds a list of controller pools, that are indexed by their policy and list of controllers.

Permits to have only one instance of ControllerPool for the same controllers and policy, thus to share the connection info (ie. on which controller the last connection occured).


Member Function Documentation

static void CarobNS::ControllerPoolManager::freePool ( AbstractControllerPool pool  )  [static]

Decrements reference counter on the given pool.

If no more references are made on this pool, removes it from the pool list and deletes it

Parameters:
pool the pool to release

static AbstractControllerPool& CarobNS::ControllerPoolManager::getPool ( std::vector< ControllerInfo > &  ctrls,
ConnectPolicy  cp,
int  pingDelayInMs,
int  controllerTimeoutInMs 
) throw (DriverException, UnexpectedException) [static]

Returns a pool for the given pair controllers/policy.


If the controller pool list already contains a pool suitable for given parameters, returns it after incrementing the reference count on it. If not found, creates a new controller pool, adds it to the list, increments its reference counter and returns it.

Parameters:
ctrls (ordered) controller list to connect to
cp policy to use
pingDelayInMs Interval in milliseconds between two pings of a controller
controllerTimeoutInMs timeout in milliseconds after which a controller is considered as dead if it did not respond to pings
Returns:
a pool following the given policy for the given controllers distribution
Exceptions:
DriverException if the given policy is invalid

static void CarobNS::ControllerPoolManager::tryTocleanUpPools (  )  [static, protected]

Walks through the pool map to look for pools that can be deleted, ie.

a pool that is not used anymore and that been freed at least POOL_TIMEOUTms ago


The documentation for this class was generated from the following file:
Generated on Fri Mar 9 17:40:20 2007 for Carob by  doxygen 1.4.7