CAsyncFileWriter Class Reference
[Asynchronous I/OI/O BuffersFileIO]

Inheritance diagram for CAsyncFileWriter:

Inheritance graph
[legend]
Collaboration diagram for CAsyncFileWriter:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class that implements IHandler to provide an asynchronous file writer that uses overlapped I/O to perform writes to the file. Any errors that occur during the asynchronous file writes are reported via the CAsyncFileWriter::Callback interface.

Public Types

typedef unsigned long DataLength

Public Member Functions

 CAsyncFileWriter (const JetByteTools::Win32::_tstring &filename, Callback &callback, IIOPool &pool, IAllocateBuffers &allocator)
 Write to the specified file asynchronously using overlapped I/O via the threads in the supplied IIOPool using buffers provided by the IAllocateBuffers instance and push any errors that occur to the CAsyncFileWriter::Callback interface.
 ~CAsyncFileWriter ()
void Write (const BYTE *const pData, const DataLength dataLength)
 Write the data to the file.
void Write (const Data *const pData, const DataLength count)
 Write the data to the file.
void Write (IBuffer *pBuffer)
 Write the contents of the IBuffer to the file.
virtual HANDLE GetWaitHandle () const
 Access a HANDLE to wait on by passing it to one of the Wait Functions.
virtual void Wait () const
 Wait indefinitely for the object to become signalled.
virtual bool Wait (const Milliseconds timeout) const
 Wait, with a time limit, for the object to become signalled.

Static Public Member Functions

static void Wait (HANDLE handle)
 Wait indefinitely for the supplied handle to become signalled.
static bool Wait (HANDLE handle, const Milliseconds timeout)
 Wait, with a time limit, for the supplied handle to become signalled.

Classes

class  Callback
 An interface for users of the CAsyncFileWriter to be notified of any errors that occur during the asynchronous write operations on the file. More...
struct  Data
 A simple structure to enable 'gather' style multiple buffer writes with minimal data copying. More...

Member Typedef Documentation

typedef unsigned long DataLength


Constructor & Destructor Documentation

CAsyncFileWriter ( const JetByteTools::Win32::_tstring filename,
Callback callback,
IIOPool pool,
IAllocateBuffers allocator 
)

Write to the specified file asynchronously using overlapped I/O via the threads in the supplied IIOPool using buffers provided by the IAllocateBuffers instance and push any errors that occur to the CAsyncFileWriter::Callback interface.

~CAsyncFileWriter (  ) 


Member Function Documentation

void Write ( const BYTE *const   pData,
const DataLength  dataLength 
)

Write the data to the file.

void Write ( const Data *const   pData,
const DataLength  count 
)

Write the data to the file.

void Write ( IBuffer pBuffer  ) 

Write the contents of the IBuffer to the file.

HANDLE GetWaitHandle (  )  const [virtual]

Access a HANDLE to wait on by passing it to one of the Wait Functions.

Implements IWaitable.

void Wait (  )  const [virtual]

Wait indefinitely for the object to become signalled.

Implements IWaitable.

virtual bool Wait ( const Milliseconds  timeout  )  const [virtual]

Wait, with a time limit, for the object to become signalled.

Implements IWaitable.

void Wait ( HANDLE  handle  )  [static, inherited]

Wait indefinitely for the supplied handle to become signalled.

bool Wait ( HANDLE  handle,
const Milliseconds  timeout 
) [static, inherited]

Wait, with a time limit, for the supplied handle to become signalled.


Generated on Tue Oct 2 15:45:24 2007 for JetByte Tools - v5.2 by  doxygen 1.5.3