EasyUSB::AsyncIO Class Reference

Asynchronous operation object. More...


Public Types

enum  Flags {
  CALLBACK_COMPLETED = 0x01, CALLBACK_CANCELLED = 0x02, CALLBACK_TIMEDOUT = 0x04, CALLBACK_FAILED = 0x08,
  CALLBACK_SUCCESS = 0x10, CALLBACK_ALL = 0x1F, FIRE_AND_FORGET = 0x20
}
 Transfer flags. More...
enum  Status {
  INPROGRESS = 0x01, CANCELLED = 0x02, TIMEDOUT = 0x04, FAILED = 0x08,
  SUCCESS = 0x10, COMPLETED = 0x80
}
 Transfer status. More...

Public Member Functions

 AsyncIO (HANDLE hFile, OVERLAPPED *pOv, Data *pData, int Flags=0)
 Constructor.
bool Cancelled ()
 True if the transfer was cancelled.
void CheckState ()
 Internally checks the transfer status.
bool Completed ()
 True if the transfer completed.
bool Failed ()
 True if the transfer failed.
Data GetData ()
 Gets a copy of the data used for the transfer.
unsigned int GetFlags ()
 Gets the flags for this transfer.
unsigned short GetStatus ()
 Gets the status of the transfer.
bool Success ()
 True if the transfer succeeded.
bool TimedOut ()
 True if the transfer timed out.
 ~AsyncIO ()
 Destructor.

Protected Member Functions

void FreeData ()
 Deletes the internal data copy.

Protected Attributes

unsigned long m_BytesReturned
 The bytes actually transfered.
unsigned int m_Flags
 Transfer flags.
Datam_pData
 Pointer to the data transfered.
unsigned short m_Status
 Transfer status.


Detailed Description

Asynchronous operation object.

The transfered data may be smaller than the supplied data object. In this case the data object is automatically truncated. The data object can never be greater than requested (driver-limitation).


Member Enumeration Documentation

Transfer flags.

Enumerator:
CALLBACK_COMPLETED  Callback if completed with any status.
CALLBACK_CANCELLED  Callback if transfer was cancelled.
CALLBACK_TIMEDOUT  Callback if transfer timed out.
CALLBACK_FAILED  Callback if transfer failed.
CALLBACK_SUCCESS  Callback if transfer succeeded.
CALLBACK_ALL  Callback combination of COMPLETED, CANCELLED, TIMEDOUT, FAILED, SUCCESS.
FIRE_AND_FORGET  Transfer object is automatically deleted after completion.

Transfer status.

Enumerator:
INPROGRESS  Transfer still pending.
CANCELLED  Transfer was cancelled.
TIMEDOUT  Transfer timed out.
FAILED  Transfer failed.
SUCCESS  Transfer succeeded.
COMPLETED  Transfer completed with any status.


Constructor & Destructor Documentation

EasyUSB::AsyncIO::AsyncIO ( HANDLE  hFile,
OVERLAPPED *  pOv,
Data pData,
int  Flags = 0 
)

Constructor.

Parameters:
hFile Windows file handle to the endpoint.
pOv Windows overlapped structure for asynchronous operations.
pData USB data object containing the data to be send.
Flags The transfer flags.

EasyUSB::AsyncIO::~AsyncIO (  ) 

Destructor.


Member Function Documentation

bool EasyUSB::AsyncIO::Cancelled (  ) 

True if the transfer was cancelled.

void EasyUSB::AsyncIO::CheckState (  ) 

Internally checks the transfer status.

bool EasyUSB::AsyncIO::Completed (  ) 

True if the transfer completed.

bool EasyUSB::AsyncIO::Failed (  ) 

True if the transfer failed.

void EasyUSB::AsyncIO::FreeData (  )  [protected]

Deletes the internal data copy.

Data EasyUSB::AsyncIO::GetData (  ) 

Gets a copy of the data used for the transfer.

unsigned int EasyUSB::AsyncIO::GetFlags (  ) 

Gets the flags for this transfer.

unsigned short EasyUSB::AsyncIO::GetStatus (  ) 

Gets the status of the transfer.

bool EasyUSB::AsyncIO::Success (  ) 

True if the transfer succeeded.

bool EasyUSB::AsyncIO::TimedOut (  ) 

True if the transfer timed out.


Field Documentation

unsigned long EasyUSB::AsyncIO::m_BytesReturned [protected]

The bytes actually transfered.

unsigned int EasyUSB::AsyncIO::m_Flags [protected]

Transfer flags.

Pointer to the data transfered.

unsigned short EasyUSB::AsyncIO::m_Status [protected]

Transfer status.


Generated on Tue Nov 4 22:13:26 2008 for EasyUSB Connect by  doxygen 1.5.6