ERUCES::TEConnectionPool
#include <teconnectionpool.h>
The TEConnectionPool class is for.
Private Attrib
| Type | Name | Description |
|---|---|---|
| TEConnectionPoolImpl * | m_impl |
Public Member Functions
| Member | Description |
|---|---|
TEConnectionPool(bool bSynchronize, size_t nMaxSize, size_t nMinSize) | |
~TEConnectionPool() | The TEConnectionPool is the class destructor. |
void attachContext(TEAuthenticationContext &ctx) | The attachContext method is to attach a TEAuthenticationContext object. |
void add(TEConnection *pConn) | The add method is to add a TEConnection object. |
void remove(TEConnection *pConn) | The remove method removes a TEConnection object. |
TEConnection * checkout() | The checkout method retrieves an idle connection. |
void checkin(TEConnection *pConn) | The checkin method releases a connection and it becomes idle. |
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort, TEAuthenticationContext &ctx) | The start method opens all connections in the pool with provided authentication context. |
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort) | |
void shutdown() | The shutdown method closes all connections in the pool. |
bool exist(TEConnection *pConn) | |
bool exist(uint32_t nHandle) | The exist method checks the existence of connection object by providing the connection handle. |
size_t size() | The size method retrieves the current size of the pool. |
size_t getMaxSize() | The getMaxSizee method retrieves the maximum size of the pool. |
size_t getMinSize() | The getMinSize method retrieves the minimum size of the pool. |
void expend(size_t nSize) |
Private Func
| Member | Description |
|---|---|
TEConnectionPool(const TEConnectionPool &) |
Member Function Documentation
TEConnectionPool(bool bSynchronize, size_t nMaxSize, size_t nMinSize)
The TEConnectionPool constructor will construct a pool with given size.
Parameters
| Parameter | Description |
|---|---|
bSynchronize | A boolean representing |
nMaxSize | An integer representing the maximum size. |
nMinSize | An integer representing the minimum size. |
~TEConnectionPool()
The TEConnectionPool is the class destructor.
void attachContext(TEAuthenticationContext &ctx)
The attachContext method is to attach a TEAuthenticationContext object.
Parameters
| Parameter | Description |
|---|---|
ctx | A TEAuthenticationContext object representing |
void add(TEConnection *pConn)
The add method is to add a TEConnection object.
Parameters
| Parameter | Description |
|---|---|
pConn | A TEConnection object representing the connection object. |
void remove(TEConnection *pConn)
The remove method removes a TEConnection object.
Parameters
| Parameter | Description |
|---|---|
pConn | A TEConnection object representing the connection object. |
TEConnection * checkout()
The checkout method retrieves an idle connection.
void checkin(TEConnection *pConn)
The checkin method releases a connection and it becomes idle.
Parameters
| Parameter | Description |
|---|---|
pConn | A TEConnection object representing the connection object. |
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort, TEAuthenticationContext &ctx)
The start method opens all connections in the pool with provided authentication context.
Parameters
| Parameter | Description |
|---|---|
nType | An integer representing the |
strServer | A string representing the Key Server name or IP address. |
nPort | An integer representing the Key Service port number. |
ctx | A TEAuthenticationContext object representing |
void start(uint32_t nType, _TESTD string &strServer, uint32_t nPort)
The start method opens all connections in the pool with an internal authentication context.
Parameters
| Parameter | Description |
|---|---|
nType | An integer representing the |
strServer | A string representing the Key Server name or IP address. |
nPort | An integer representing the Key Service port number. |
void shutdown()
The shutdown method closes all connections in the pool.
bool exist(TEConnection *pConn)
The exist method checks the existence of connection object by providing the connection object. @param pConn A TEConnection object representing the connection object.
Returns: A boolean representing whether on not the TEConnection object exists. True = exists.
bool exist(uint32_t nHandle)
The exist method checks the existence of connection object by providing the connection handle.
Parameters
| Parameter | Description |
|---|---|
nHandle | An integer representing the connection handle. |
Returns: A boolean representing whether on not the TEConnection object exists. True = exists.
size_t size()
The size method retrieves the current size of the pool.
Returns: An integer representing the size of the pool.
size_t getMaxSize()
The getMaxSizee method retrieves the maximum size of the pool.
Returns: An integer representing the maximum size of the pool.
size_t getMinSize()
The getMinSize method retrieves the minimum size of the pool.
Returns: An integer representing the minimum size of the pool.
void expend(size_t nSize)
The expend method expends the maximum size of the pool.
Parameters
| Parameter | Description |
|---|---|
nSize | An integer representing the maximum size of the connection pool. |