asio 0.1.5 Main Page | Class Index | Member Index | Tutorial

counting_completion_context Class Reference

The counting_completion_context class is a concrete implementation of the Completion_Context concept. It allows a limitation on the number of concurrent upcalls to completion handlers that may be associated with the context. Copies of an instance of this class represent the same context as the original. More...

List of all members.

Public Member Functions

 counting_completion_context ()
 Default constructor.

 counting_completion_context (int max_concurrent_upcalls)
 Construct with a specified limit on the number of upcalls.

 counting_completion_context (const counting_completion_context &other)
 Copy constructor.

 ~counting_completion_context ()
 Destructor.

counting_completion_contextoperator= (const counting_completion_context &other)
 Assignment operator.

bool try_acquire ()
 Attempt to acquire the right to make an upcall.

template<typename Handler> void acquire (Handler handler)
 Acquire the right to make an upcall.

void release ()
 Relinquish a previously granted right to make an upcall.


Detailed Description

The counting_completion_context class is a concrete implementation of the Completion_Context concept. It allows a limitation on the number of concurrent upcalls to completion handlers that may be associated with the context. Copies of an instance of this class represent the same context as the original.


Constructor & Destructor Documentation

counting_completion_context  ) 
 

Default constructor.

counting_completion_context int  max_concurrent_upcalls  )  [explicit]
 

Construct with a specified limit on the number of upcalls.

counting_completion_context const counting_completion_context other  ) 
 

Copy constructor.

~counting_completion_context  ) 
 

Destructor.


Member Function Documentation

counting_completion_context& operator= const counting_completion_context other  ) 
 

Assignment operator.

bool try_acquire  ) 
 

Attempt to acquire the right to make an upcall.

void acquire Handler  handler  ) 
 

Acquire the right to make an upcall.

void release  ) 
 

Relinquish a previously granted right to make an upcall.