ILimitConnections::Creator Class Reference
[RAII - Resource Acquisition Is Initialization]

Collaboration diagram for ILimitConnections::Creator:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class that takes ownership of an attempt at connection creation. That is if you call CanCreateConnection() through it and then do not call ConnectionCreated() then the destructor will assume something went awry and call ReleaseConnection(). This class can therefore be used to support scope based connection creation.

Public Member Functions

 Creator (ILimitConnections &limiter)
 Construct an instance of a Creator that uses the supplied connection limiter to determine if a connection can be created.
 ~Creator ()
 If a call to CanCreateConnection() has succeeded and there hasn't been a call to ConnectionCreated() then we call ILimitConnections::ReleaseConnection().
bool CanCreateConnection ()
 Query the connection limiter to see if a connection can be created and if it can assume that it is now in the process of being created.
void ConnectionCreated ()
 Confirm that the connection has been created.

Constructor & Destructor Documentation

Creator ( ILimitConnections limiter  )  [explicit]

Construct an instance of a Creator that uses the supplied connection limiter to determine if a connection can be created.

~Creator (  ) 

If a call to CanCreateConnection() has succeeded and there hasn't been a call to ConnectionCreated() then we call ILimitConnections::ReleaseConnection().


Member Function Documentation

bool CanCreateConnection (  ) 

Query the connection limiter to see if a connection can be created and if it can assume that it is now in the process of being created.

void ConnectionCreated (  ) 

Confirm that the connection has been created.


Generated on Mon Sep 7 14:09:31 2009 for JetByte Socket Tools - v6.1 by  doxygen 1.5.3