My Project
Public Member Functions | List of all members
ParaEngine::IDataProcessor Class Referenceabstract

IDataProcessor is an interface that the AsyncLoader class uses to process and copy data into locked resource pointers. More...

#include <IDataLoader.h>

Inheritance diagram for ParaEngine::IDataProcessor:
ParaEngine::CadModelProcessor ParaEngine::CCCSFaceProcessor ParaEngine::CCCSSkinProcessor ParaEngine::CMeshProcessor ParaEngine::CParaXProcessor ParaEngine::CTextureProcessor ParaEngine::CUrlProcessor

Public Member Functions

virtual HRESULT LockDeviceObject ()=0
 LockDeviceObject is called from the Graphics thread to lock the device object (D3D9), unless IsDeviceObject() is false. More...
 
virtual HRESULT UnLockDeviceObject ()=0
 UnLockDeviceObject is called from the Graphics thread to unlock the device object, or call updatesubresource for D3D10, unless IsDeviceObject() is false. More...
 
virtual HRESULT Destroy ()=0
 Destroy is called by the graphics thread when it has consumed the data, unless IsDeviceObject() is false. More...
 
virtual HRESULT Process (void *pData, int cBytes)=0
 Process is called by one of the processing threads to process the data before it is consumed. More...
 
virtual HRESULT CopyToResource ()=0
 CopyToResource copies the data from memory to the locked device object (D3D9). More...
 
virtual void SetResourceError ()=0
 SetResourceError is called to set the resource pointer to an error code in the event that something went wrong. More...
 
virtual void SetProcessorWorkerData (IProcessorWorkerData *pThreadLocalData)
 set thread local data. More...
 
virtual IProcessorWorkerDataGetProcessorWorkerData ()
 get thread local data. More...
 
virtual bool IsDeviceObject ()
 default to true. More...
 

Detailed Description

IDataProcessor is an interface that the AsyncLoader class uses to process and copy data into locked resource pointers.

Process is called by one of the processing threads to process the data before it is consumed. LockDeviceObject is called from the Graphics thread to lock the device object (D3D9). UnLockDeviceObject is called from the Graphics thread to unlock the device object, or to call updatesubresource for D3D10. CopyToResource copies the data from memory to the locked device object (D3D9). SetResourceError is called to set the resource pointer to an error code in the event that something went wrong. Destroy is called by the graphics thread when it has consumed the data.

Member Function Documentation

§ CopyToResource()

virtual HRESULT ParaEngine::IDataProcessor::CopyToResource ( )
pure virtual

CopyToResource copies the data from memory to the locked device object (D3D9).

Also by the IO thread.

Implemented in ParaEngine::CTextureProcessor, ParaEngine::CMeshProcessor, ParaEngine::CUrlProcessor, ParaEngine::CCCSFaceProcessor, ParaEngine::CCCSSkinProcessor, ParaEngine::CParaXProcessor, and ParaEngine::CadModelProcessor.

§ Destroy()

virtual HRESULT ParaEngine::IDataProcessor::Destroy ( )
pure virtual

§ GetProcessorWorkerData()

virtual IProcessorWorkerData* ParaEngine::IDataProcessor::GetProcessorWorkerData ( )
inlinevirtual

get thread local data.

It may return NULL if the processor does not support thread local data.

Reimplemented in ParaEngine::CUrlProcessor.

§ IsDeviceObject()

virtual bool ParaEngine::IDataProcessor::IsDeviceObject ( )
inlinevirtual

default to true.

If not true, LockDeviceObject, UnLockDeviceObject are not called and Destroy will be called in the worker thread instead of render thread.

Reimplemented in ParaEngine::CUrlProcessor.

§ LockDeviceObject()

virtual HRESULT ParaEngine::IDataProcessor::LockDeviceObject ( )
pure virtual

§ Process()

virtual HRESULT ParaEngine::IDataProcessor::Process ( void *  pData,
int  cBytes 
)
pure virtual

§ SetProcessorWorkerData()

virtual void ParaEngine::IDataProcessor::SetProcessorWorkerData ( IProcessorWorkerData pThreadLocalData)
inlinevirtual

set thread local data.

Reimplemented in ParaEngine::CUrlProcessor.

§ SetResourceError()

virtual void ParaEngine::IDataProcessor::SetResourceError ( )
pure virtual

SetResourceError is called to set the resource pointer to an error code in the event that something went wrong.

Implemented in ParaEngine::CTextureProcessor, ParaEngine::CMeshProcessor, ParaEngine::CUrlProcessor, ParaEngine::CCCSFaceProcessor, ParaEngine::CCCSSkinProcessor, ParaEngine::CParaXProcessor, and ParaEngine::CadModelProcessor.

§ UnLockDeviceObject()

virtual HRESULT ParaEngine::IDataProcessor::UnLockDeviceObject ( )
pure virtual

UnLockDeviceObject is called from the Graphics thread to unlock the device object, or call updatesubresource for D3D10, unless IsDeviceObject() is false.

Implemented in ParaEngine::CTextureProcessor, ParaEngine::CMeshProcessor, ParaEngine::CUrlProcessor, ParaEngine::CCCSFaceProcessor, ParaEngine::CCCSSkinProcessor, ParaEngine::CParaXProcessor, and ParaEngine::CadModelProcessor.


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