Client id allocation facility.
More...
#include <client_id_manager.hpp>
|
size_t | allocate (const string &type, int handle) |
| Allocates client identifier.
|
|
| ClientIdManager () |
| Constructor.
|
|
void | free (size_t handle) |
| Frees an object.
|
|
bool | registerConnectionType (const string &connectionType, unsigned int maxConnectionCount) |
| Register a connection type to the manager Note: double registration is allowed and does not lead to duplicate connection ranges.
|
|
int | translate (size_t handle) const |
| Translate a pseudo handle to a native handle.
|
|
int | translateAndFree (size_t handle) |
| Translate a pseudo handle to a native handle and with same call free the mapping.
|
|
const string & | typeOf (size_t handle) const |
| Returns the type identifier of the specific handle.
|
|
Client id allocation facility.
◆ ClientIdManager()
kanzi::connect::ClientIdManager::ClientIdManager |
( |
| ) |
|
◆ allocate()
size_t kanzi::connect::ClientIdManager::allocate |
( |
const string & | type, |
|
|
int | handle ) |
Allocates client identifier.
- Parameters
-
type | the type of client identifier to allocate. |
handle | |
- Returns
- identifier. 0 (=INVALID_CLIENT_IDENTIFIER) indicates invalid value.
◆ free()
void kanzi::connect::ClientIdManager::free |
( |
size_t | handle | ) |
|
Frees an object.
- Parameters
-
handle | the handle to free. |
◆ registerConnectionType()
bool kanzi::connect::ClientIdManager::registerConnectionType |
( |
const string & | connectionType, |
|
|
unsigned int | maxConnectionCount ) |
Register a connection type to the manager Note: double registration is allowed and does not lead to duplicate connection ranges.
- Parameters
-
connectionType | Identifies the connection type |
maxConnectionCount | How many connections of this type are allowed simultaneously to be reserved |
◆ translate()
int kanzi::connect::ClientIdManager::translate |
( |
size_t | handle | ) |
const |
Translate a pseudo handle to a native handle.
Type information not passed so searches for suitable native handle from all the types.
- Parameters
-
handle | the handle to translate |
- Returns
- native handle. -1 is returned if not found.
◆ translateAndFree()
int kanzi::connect::ClientIdManager::translateAndFree |
( |
size_t | handle | ) |
|
Translate a pseudo handle to a native handle and with same call free the mapping.
- Parameters
-
handle | the handle to translate |
- Returns
- native handle. -1 is returned if not found.
◆ typeOf()
const string & kanzi::connect::ClientIdManager::typeOf |
( |
size_t | handle | ) |
const |
Returns the type identifier of the specific handle.
- Parameters
-
- Returns
- type identifier string. empty string returned if not found.
◆ TYPE_HTTP
const string kanzi::connect::ClientIdManager::TYPE_HTTP |
|
static |
◆ TYPE_SCRIPTING
const string kanzi::connect::ClientIdManager::TYPE_SCRIPTING |
|
static |
◆ TYPE_SHAREDMEMORY
const string kanzi::connect::ClientIdManager::TYPE_SHAREDMEMORY |
|
static |
◆ TYPE_SOCKET
const string kanzi::connect::ClientIdManager::TYPE_SOCKET |
|
static |
The documentation for this class was generated from the following file:
- connection_service/client_id_manager.hpp