📄 mguardscreqhandler.h
字号:
/*
* ============================================================================
* Name : MGuardScReqHandler.h
* Part of : MGuardCmdHandler
* Created : 19.08.2007 by xueyw
* Description:
* Version :
* Copyright:
* ============================================================================
*/
#ifndef __MGUARDSCREQHANDLER_H__
#define __MGUARDSCREQHANDLER_H__
// INCLUDE FILES
#include <e32base.h>
#include "MGuardScSvrSession.h"
// FORWARD DECLARATIONS
class MMGuardScObserver;
// CLASS DECLARATION
/**
* CMGuardScReqHandler
* An instance of the request handler object for the ClientServerAsync
* example application
*/
class CMGuardScReqHandler : public CActive
{
public: // Constructors and destructors
/**
* NewL.
* Two-phased constructor.
* Creates a CCSAsyncRequestHandler object using two phase construction,
* and return a pointer to the created object.
* @param aObserver The object to be used to
* handle updates from the server.
* @return A pointer to the created instance of CCSAsyncRequestHandler.
*/
static CMGuardScReqHandler* NewL( MMGuardScObserver& aObserver );
/**
* NewLC.
* Two-phased constructor.
* Creates a CCSAsyncRequestHandler object using two phase construction,
* and return a pointer to the created object.
* @param aObserver The object to be used to
* handle updates from the server.
* @return A pointer to the created instance of CCSAsyncRequestHandler.
*/
static CMGuardScReqHandler* NewLC( MMGuardScObserver& aObserver );
/**
* ~CMGuardScReqHandler.
* Destructor.
* Destroys the object and release all memory objects.
*/
virtual ~CMGuardScReqHandler();
public: // New functions
/**
* RequestLock.
* Sends a request to the server for an update to the time.
*/
void RequestLock();
void RequestUnlock();
/**
* CancelRequest.
* Cancels an outstanding request.
*/
void CancelRequest() ;
/**
* Time.
* Gets a copy of the last time received from the server.
* @return The time.
*/
TTime Time() const;
protected: // Functions from base classes
/**
* From CActive, RunL.
* Callback function.
* Invoked to handle responses from the server.
*/
void RunL();
/**
* From CActive, DoCancel.
* Cancels any outstanding operation.
*/
void DoCancel();
private: // Constructors and destructors
/**
* CMGuardScReqHandler.
* Performs the first phase of two phase construction.
* @param aObserver The object to be used to
* handle updates from the server.
*/
CMGuardScReqHandler( MMGuardScObserver& aObserver );
/**
* ConstructL.
* Performs the second phase construction of a
* CMGuardScReqHandler object.
*/
void ConstructL();
private: // Data
/**
* iSession, the time server session.
*/
RMGuardSvrSession iSession;
/**
* iTime, passed to the session to store the time.
*/
TTime iTime;
/**
* iObserver, observer which handles updates from the server.
*/
MMGuardScObserver& iObserver;
};
#endif //__CCSASYNCREQUESTHANDLER_H__
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -