Developer Guide and Reference

Contents

Template Class async_class

This topic only applies to Windows* OS.
Intel's C++ asynchronous I/O class implementation contains two main classes within the
async
namespace: the
async_class
template class and the
thread_control
base class.
The header/typedef definitions are as follows:
namespace async { template<class A> class async_class: public thread_control, public A }
The template class
async_class
inherits support for asynchronous execution of I/O operations that are integrated within the base
thread_control
class.
All functionality to control asynchronous execution of a queue of STL stream operations is encapsulated in the base class
thread_control
and is inherited by template class
async_class
.
In most cases it is enough to add the header file
aiostream.h
to the source file and declare the file object as an instance of the new template class
async:async_class
. The initial stream class must be the parameter for the template class. Consequently, the defined output operator
<<
and input operator
>>
are executed asynchronously.
The header file
aiostream.h
includes all necessary declarations for the STL stream I/O operations to add asynchronous functionality of the
thread_control
class. It also contains the necessary declarations of extensions for the standard C++ STL streams I/O operations: output operator
>>
and input operator
<<
.
You can call synchronization method
wait()
to wait for completion of any I/O operations with the file object. If the
wait()
method is not called explicitly, it is called implicitly in the object destructor.

Public Interface of Template Class async_class

The following methods define the public interface of the template class
async_class
: