CAsyncIo Class Reference

#include <asyncio.h>

List of all members.

Public Member Functions

 CAsyncIo (CAsyncStream *pStream)
 ~CAsyncIo ()
HRESULT Open (LPCTSTR pName)
HRESULT AsyncActive (void)
HRESULT AsyncInactive (void)
HRESULT Request (LONGLONG llPos, LONG lLength, BOOL bAligned, BYTE *pBuffer, LPVOID pContext, DWORD dwUser)
HRESULT WaitForNext (DWORD dwTimeout, LPVOID *ppContext, DWORD *pdwUser, LONG *pcbActual)
HRESULT SyncReadAligned (LONGLONG llPos, LONG lLength, BYTE *pBuffer, LONG *pcbActual, PVOID pvContext)
HRESULT SyncRead (LONGLONG llPos, LONG lLength, BYTE *pBuffer)
HRESULT Length (LONGLONG *pllTotal, LONGLONG *pllAvailable)
HRESULT Alignment (LONG *pl)
HRESULT BeginFlush ()
HRESULT EndFlush ()
LONG Alignment ()
BOOL IsAligned (LONG l)
BOOL IsAligned (LONGLONG ll)
HANDLE StopEvent () const

Private Member Functions

LONGLONG Size ()
HRESULT StartThread (void)
HRESULT CloseThread (void)
CAsyncRequestGetWorkItem ()
CAsyncRequestGetDoneItem ()
HRESULT PutWorkItem (CAsyncRequest *pRequest)
HRESULT PutDoneItem (CAsyncRequest *pRequest)
void ProcessRequests (void)
DWORD ThreadProc (void)

Static Private Member Functions

static DWORD WINAPI InitialThreadProc (LPVOID pv)

Private Attributes

CCritSec m_csReader
CAsyncStreamm_pStream
CCritSec m_csLists
BOOL m_bFlushing
CRequestList m_listWork
CRequestList m_listDone
CAMEvent m_evWork
CAMEvent m_evDone
LONG m_cItemsOut
BOOL m_bWaiting
CAMEvent m_evAllDone
CAMEvent m_evStop
HANDLE m_hThread


Detailed Description

Definition at line 89 of file asyncio.h.


Constructor & Destructor Documentation

CAsyncIo::CAsyncIo ( CAsyncStream pStream  ) 

Definition at line 66 of file asyncio.cpp.

CAsyncIo::~CAsyncIo (  ) 


Member Function Documentation

LONGLONG CAsyncIo::Size (  )  [inline, private]

Definition at line 110 of file asyncio.h.

References ASSERT, m_pStream, NULL, and CAsyncStream::Size().

Referenced by WaitForNext().

HRESULT CAsyncIo::StartThread ( void   )  [private]

Definition at line 350 of file asyncio.cpp.

References GetLastError(), InitialThreadProc(), m_evStop, m_hThread, NULL, CAMEvent::Reset(), and S_OK.

Referenced by AsyncActive(), and PutWorkItem().

HRESULT CAsyncIo::CloseThread ( void   )  [private]

Definition at line 375 of file asyncio.cpp.

References m_evStop, m_hThread, NULL, S_OK, and CAMEvent::Set().

Referenced by AsyncInactive(), and ~CAsyncIo().

CAsyncRequest * CAsyncIo::GetWorkItem (  )  [private]

CAsyncRequest * CAsyncIo::GetDoneItem (  )  [private]

HRESULT CAsyncIo::PutWorkItem ( CAsyncRequest pRequest  )  [private]

HRESULT CAsyncIo::PutDoneItem ( CAsyncRequest pRequest  )  [private]

void CAsyncIo::ProcessRequests ( void   )  [private]

static DWORD WINAPI CAsyncIo::InitialThreadProc ( LPVOID  pv  )  [inline, static, private]

Definition at line 143 of file asyncio.h.

References ThreadProc().

Referenced by StartThread().

DWORD CAsyncIo::ThreadProc ( void   )  [private]

Definition at line 505 of file asyncio.cpp.

References FALSE, m_evStop, m_evWork, and ProcessRequests().

Referenced by InitialThreadProc().

HRESULT CAsyncIo::Open ( LPCTSTR  pName  ) 

HRESULT CAsyncIo::AsyncActive ( void   ) 

Definition at line 99 of file asyncio.cpp.

References StartThread().

HRESULT CAsyncIo::AsyncInactive ( void   ) 

Definition at line 105 of file asyncio.cpp.

References CloseThread().

HRESULT CAsyncIo::Request ( LONGLONG  llPos,
LONG  lLength,
BOOL  bAligned,
BYTE pBuffer,
LPVOID  pContext,
DWORD  dwUser 
)

Definition at line 111 of file asyncio.cpp.

References FAILED, hr, HRESULT, IsAligned(), LONG, m_pStream, PutWorkItem(), and CAsyncRequest::Request().

Referenced by CAsyncOutputPin::Request().

HRESULT CAsyncIo::WaitForNext ( DWORD  dwTimeout,
LPVOID ppContext,
DWORD *  pdwUser,
LONG pcbActual 
)

HRESULT CAsyncIo::SyncReadAligned ( LONGLONG  llPos,
LONG  lLength,
BYTE pBuffer,
LONG pcbActual,
PVOID  pvContext 
)

HRESULT CAsyncIo::SyncRead ( LONGLONG  llPos,
LONG  lLength,
BYTE pBuffer 
)

HRESULT CAsyncIo::Length ( LONGLONG pllTotal,
LONGLONG pllAvailable 
)

HRESULT CAsyncIo::Alignment ( LONG pl  ) 

HRESULT CAsyncIo::BeginFlush ( void   ) 

HRESULT CAsyncIo::EndFlush ( void   ) 

LONG CAsyncIo::Alignment (  )  [inline]

Definition at line 209 of file asyncio.h.

References CAsyncStream::Alignment(), and m_pStream.

Referenced by Alignment(), and IsAligned().

BOOL CAsyncIo::IsAligned ( LONG  l  )  [inline]

Definition at line 214 of file asyncio.h.

References Alignment(), FALSE, and TRUE.

Referenced by IsAligned(), Request(), CAsyncOutputPin::RequestAllocator(), SyncRead(), and SyncReadAligned().

BOOL CAsyncIo::IsAligned ( LONGLONG  ll  )  [inline]

Definition at line 222 of file asyncio.h.

References IsAligned(), and LONG.

HANDLE CAsyncIo::StopEvent (  )  const [inline]

Definition at line 227 of file asyncio.h.

References m_evDone.


Member Data Documentation

Definition at line 92 of file asyncio.h.

Definition at line 93 of file asyncio.h.

Referenced by Alignment(), Length(), Request(), Size(), SyncRead(), and SyncReadAligned().

BOOL CAsyncIo::m_bFlushing [private]

Definition at line 96 of file asyncio.h.

Referenced by BeginFlush(), EndFlush(), GetDoneItem(), PutWorkItem(), and WaitForNext().

Definition at line 97 of file asyncio.h.

Referenced by GetWorkItem(), and PutWorkItem().

Definition at line 98 of file asyncio.h.

Referenced by EndFlush(), GetDoneItem(), PutDoneItem(), and ~CAsyncIo().

Definition at line 99 of file asyncio.h.

Referenced by GetWorkItem(), PutWorkItem(), and ThreadProc().

Definition at line 100 of file asyncio.h.

Referenced by BeginFlush(), EndFlush(), GetDoneItem(), PutDoneItem(), StopEvent(), and WaitForNext().

Definition at line 103 of file asyncio.h.

Referenced by BeginFlush(), and ProcessRequests().

BOOL CAsyncIo::m_bWaiting [private]

Definition at line 104 of file asyncio.h.

Referenced by BeginFlush(), EndFlush(), GetDoneItem(), ProcessRequests(), and WaitForNext().

Definition at line 105 of file asyncio.h.

Referenced by BeginFlush(), and ProcessRequests().

Definition at line 107 of file asyncio.h.

Referenced by CloseThread(), StartThread(), and ThreadProc().

HANDLE CAsyncIo::m_hThread [private]

Definition at line 108 of file asyncio.h.

Referenced by CloseThread(), and StartThread().


The documentation for this class was generated from the following files:

Generated on Sun May 25 00:20:33 2008 by  doxygen 1.5.6