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

null_completion_context Class Reference

The null_completion_context class is a concrete implementation of the Completion_Context concept. It does not place any limits on the number of concurrent upcalls to completion handlers that may be associated with the context. All instances of this class are equivalent. More...

List of all members.

Public Member Functions

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 null_completion_context class is a concrete implementation of the Completion_Context concept. It does not place any limits on the number of concurrent upcalls to completion handlers that may be associated with the context. All instances of this class are equivalent.


Member Function Documentation

bool try_acquire  ) 
 

Attempt to acquire the right to make an upcall.

This function is called to attempt to obtain the right to make an upcall to a completion handler. This function always returns a result immediately.

If the right to make an upcall was successfully acquired, then a later call must be made to the release() function to relinquish that right.

Returns:
Returns true if the right to make an upcall was granted.

void acquire Handler  handler  ) 
 

Acquire the right to make an upcall.

This function is called to obtain the right to make an upcall to a completion handler. The handler will be called when the right is granted.

Parameters:
handler The function object to be called when the right is granted.

void release  ) 
 

Relinquish a previously granted right to make an upcall.