- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
chxavactivecompletiondispatch.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:3k
源码类别:
Symbian
开发平台:
Visual C++
- /************************************************************************
- * chxavactivecompletiondispatch.h
- * -------------------------------
- *
- * Synopsis:
- *
- * Dispatch for CAtive derived objects.
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- ************************************************************************/
- #ifndef _chxavactivecompletiondispatch_h_
- #define _chxavactivecompletiondispatch_h_
- // Symbian includes...
- #include <e32base.h>
- #include <basched.h>
- // Helix includes...
- #include "unkimp.h"
- #include "ihxpckts.h"
- #include "hxstring.h"
- #include "hxurl.h"
- #include "hxwintyp.h"
- #include "hxcom.h"
- #include "hxcomm.h"
- #include "hxmon.h"
- #include "hxfiles.h"
- #include "hxcore.h"
- #include "hxwin.h"
- // Include from this project...
- #include "chxbody.h"
- #include "chxmakesmartptr.h"
- // CHXAvActiveCmpl:
- // Active Object completion dispatch.
- class CHXAvActiveCmpl :
- public CActive, public CHXBody
- {
- public:
- CHXAvActiveCmpl() : CActive(0) {}
- virtual ~CHXAvActiveCmpl() {}
- virtual TRequestStatus& Status() = 0;
- virtual void RunL() = 0;
- virtual void Activate() = 0;
- protected:
- virtual void DoCancel() = 0;
- };
- MakeSmartPtr(CHXAvActiveCmpl); // Create a smart pointer class CHXAvActiveCmplPtr
- template<class Recv>
- class CHXAvActiveDisp : public CHXAvActiveCmpl {
- public:
- typedef void (Recv::*FuncPtr)(int);
- CHXAvActiveDisp(Recv* pRecv, FuncPtr pCmpl, FuncPtr pCancel);
- virtual ~CHXAvActiveDisp();
- virtual TRequestStatus& Status();
- virtual void RunL();
- virtual void Activate();
- protected:
- virtual void DoCancel();
- private:
- Recv* m_pRecv; // Object receiving completion
- FuncPtr m_pCmpl; // Completion function
- FuncPtr m_pCancel; // Cancel function
- };
- template<class Recv>
- inline
- CHXAvActiveDisp<Recv>::CHXAvActiveDisp(Recv* pRecv, FuncPtr pCmpl, FuncPtr pCancel)
- : m_pRecv(pRecv),
- m_pCmpl(pCmpl),
- m_pCancel(pCancel)
- {}
- template<class Recv>
- inline
- CHXAvActiveDisp<Recv>::~CHXAvActiveDisp()
- {
- }
- template<class Recv>
- inline
- TRequestStatus& CHXAvActiveDisp<Recv>::Status()
- {
- return iStatus;
- }
- template<class Recv>
- inline
- void CHXAvActiveDisp<Recv>::RunL()
- {
- #if defined(DEBUG)
- // our active object should not be leaving (except new)
- TRAPD(err,
- (m_pRecv->*m_pCmpl)(iStatus.Int()) );
- HX_ASSERT(err == KErrNone);
- User::LeaveIfError(err); // possibly continue leaving
- #else
- (m_pRecv->*m_pCmpl)(iStatus.Int());
- #endif
- }
- template<class Recv>
- inline
- void CHXAvActiveDisp<Recv>::DoCancel()
- {
- (m_pRecv->*m_pCancel)(0);
- }
- template<class Recv>
- inline
- void CHXAvActiveDisp<Recv>::Activate()
- {
- if (!IsActive())
- SetActive();
- }
- #endif // _chxavactivecompletiondispatch_h_