#include <asyncio.h>
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) |
| CAsyncRequest * | GetWorkItem () |
| CAsyncRequest * | GetDoneItem () |
| 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 |
| CAsyncStream * | m_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 |
Definition at line 89 of file asyncio.h.
| CAsyncIo::CAsyncIo | ( | CAsyncStream * | pStream | ) |
Definition at line 66 of file asyncio.cpp.
| CAsyncIo::~CAsyncIo | ( | ) |
Definition at line 81 of file asyncio.cpp.
References BeginFlush(), CloseThread(), CGenericList< OBJECT >::GetHeadPosition(), CGenericList< OBJECT >::GetNext(), m_listDone, pos(), and CBaseList::RemoveAll().
| 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] |
Definition at line 390 of file asyncio.cpp.
References CGenericList< OBJECT >::GetCount(), m_csLists, m_evWork, m_listWork, CGenericList< OBJECT >::RemoveHead(), and CAMEvent::Reset().
Referenced by BeginFlush(), and ProcessRequests().
| CAsyncRequest * CAsyncIo::GetDoneItem | ( | ) | [private] |
Definition at line 404 of file asyncio.cpp.
References CGenericList< OBJECT >::GetCount(), m_bFlushing, m_bWaiting, m_csLists, m_evDone, m_listDone, CGenericList< OBJECT >::RemoveHead(), and CAMEvent::Reset().
Referenced by WaitForNext().
| HRESULT CAsyncIo::PutWorkItem | ( | CAsyncRequest * | pRequest | ) | [private] |
Definition at line 429 of file asyncio.cpp.
References CGenericList< OBJECT >::AddTail(), E_OUTOFMEMORY, hr, HRESULT, m_bFlushing, m_csLists, m_evWork, m_listWork, CAMEvent::Set(), and StartThread().
Referenced by Request().
| HRESULT CAsyncIo::PutDoneItem | ( | CAsyncRequest * | pRequest | ) | [private] |
Definition at line 452 of file asyncio.cpp.
References CGenericList< OBJECT >::AddTail(), ASSERT, CritCheckIn, E_OUTOFMEMORY, m_csLists, m_evDone, m_listDone, S_OK, and CAMEvent::Set().
Referenced by BeginFlush(), and ProcessRequests().
| void CAsyncIo::ProcessRequests | ( | void | ) | [private] |
Definition at line 467 of file asyncio.cpp.
References CAsyncRequest::Complete(), GetWorkItem(), l, m_bWaiting, m_cItemsOut, m_csLists, m_evAllDone, NULL, PutDoneItem(), and CAMEvent::Set().
Referenced by ThreadProc().
| static DWORD WINAPI CAsyncIo::InitialThreadProc | ( | LPVOID | pv | ) | [inline, static, private] |
| 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 | ) |
| HRESULT CAsyncIo::AsyncInactive | ( | void | ) |
| 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 | |||
| ) |
Definition at line 150 of file asyncio.cpp.
References E_FAIL, CAsyncRequest::GetActualLength(), CAsyncRequest::GetContext(), GetDoneItem(), CAsyncRequest::GetHResult(), CAsyncRequest::GetStart(), CAsyncRequest::GetUser(), hr, HRESULT, m_bFlushing, m_bWaiting, m_csLists, m_evDone, NULL, S_FALSE, S_OK, Size(), and CAMEvent::Wait().
Referenced by CAsyncOutputPin::WaitForNext().
| HRESULT CAsyncIo::SyncReadAligned | ( | LONGLONG | llPos, | |
| LONG | lLength, | |||
| BYTE * | pBuffer, | |||
| LONG * | pcbActual, | |||
| PVOID | pvContext | |||
| ) |
Definition at line 218 of file asyncio.cpp.
References CAsyncRequest::Complete(), FAILED, CAsyncRequest::GetActualLength(), hr, HRESULT, IsAligned(), LONG, m_pStream, CAsyncRequest::Request(), and TRUE.
Referenced by SyncRead(), and CAsyncOutputPin::SyncReadAligned().
Definition at line 527 of file asyncio.cpp.
References CAsyncRequest::Complete(), FAILED, FALSE, hr, HRESULT, IsAligned(), LONG, m_pStream, NULL, CAsyncRequest::Request(), and SyncReadAligned().
Referenced by CAsyncOutputPin::SyncRead().
Definition at line 256 of file asyncio.cpp.
References m_pStream, and CAsyncStream::Size().
Referenced by CAsyncOutputPin::Length(), CAsyncOutputPin::Request(), and CAsyncOutputPin::SyncReadAligned().
| HRESULT CAsyncIo::Alignment | ( | LONG * | pl | ) |
Definition at line 562 of file asyncio.cpp.
References Alignment(), and S_OK.
Referenced by CAsyncOutputPin::Request(), CAsyncOutputPin::RequestAllocator(), and CAsyncOutputPin::SyncReadAligned().
| HRESULT CAsyncIo::BeginFlush | ( | void | ) |
Definition at line 262 of file asyncio.cpp.
References ASSERT, CAsyncRequest::Cancel(), FALSE, GetWorkItem(), m_bFlushing, m_bWaiting, m_cItemsOut, m_csLists, m_evAllDone, m_evDone, PutDoneItem(), S_OK, CAMEvent::Set(), TRUE, and CAMEvent::Wait().
Referenced by CAsyncOutputPin::BeginFlush(), and ~CAsyncIo().
| HRESULT CAsyncIo::EndFlush | ( | void | ) |
Definition at line 330 of file asyncio.cpp.
References ASSERT, FALSE, CGenericList< OBJECT >::GetCount(), m_bFlushing, m_bWaiting, m_csLists, m_evDone, m_listDone, CAMEvent::Reset(), S_OK, and CAMEvent::Set().
Referenced by CAsyncOutputPin::EndFlush().
| 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] |
| HANDLE CAsyncIo::StopEvent | ( | ) | const [inline] |
CCritSec CAsyncIo::m_csReader [private] |
CAsyncStream* CAsyncIo::m_pStream [private] |
Definition at line 93 of file asyncio.h.
Referenced by Alignment(), Length(), Request(), Size(), SyncRead(), and SyncReadAligned().
CCritSec CAsyncIo::m_csLists [private] |
Definition at line 95 of file asyncio.h.
Referenced by BeginFlush(), EndFlush(), GetDoneItem(), GetWorkItem(), ProcessRequests(), PutDoneItem(), PutWorkItem(), and WaitForNext().
BOOL CAsyncIo::m_bFlushing [private] |
Definition at line 96 of file asyncio.h.
Referenced by BeginFlush(), EndFlush(), GetDoneItem(), PutWorkItem(), and WaitForNext().
CRequestList CAsyncIo::m_listWork [private] |
CRequestList CAsyncIo::m_listDone [private] |
Definition at line 98 of file asyncio.h.
Referenced by EndFlush(), GetDoneItem(), PutDoneItem(), and ~CAsyncIo().
CAMEvent CAsyncIo::m_evWork [private] |
Definition at line 99 of file asyncio.h.
Referenced by GetWorkItem(), PutWorkItem(), and ThreadProc().
CAMEvent CAsyncIo::m_evDone [private] |
Definition at line 100 of file asyncio.h.
Referenced by BeginFlush(), EndFlush(), GetDoneItem(), PutDoneItem(), StopEvent(), and WaitForNext().
LONG CAsyncIo::m_cItemsOut [private] |
BOOL CAsyncIo::m_bWaiting [private] |
Definition at line 104 of file asyncio.h.
Referenced by BeginFlush(), EndFlush(), GetDoneItem(), ProcessRequests(), and WaitForNext().
CAMEvent CAsyncIo::m_evAllDone [private] |
CAMEvent CAsyncIo::m_evStop [private] |
Definition at line 107 of file asyncio.h.
Referenced by CloseThread(), StartThread(), and ThreadProc().
HANDLE CAsyncIo::m_hThread [private] |
1.5.6