?? transport.h
字號:
// Copyright (c) 2004 - 2007, Symbian Software Ltd. All rights reserved.
#ifndef TRANSPORT_H
#define TRANSPORT_H
#include <transportinterface.h>
class CTransport : public CTransportInterface
/**
Provides functionality which is common to all
transport interface implementations.
*/
{
protected:
IMPORT_C CTransport(MTransportObserver& aObserver);
IMPORT_C void ConstructL(TBool aInitListen);
// partially implement CActive
IMPORT_C virtual void RunL();
IMPORT_C virtual TInt RunError(TInt aError);
IMPORT_C void CompleteSelf(TInt aError);
IMPORT_C void CompleteSelfIfError(TInt aError);
private:
// implement CTransportInterface
IMPORT_C virtual void SendPayload(const TDesC& aPayload);
void LaunchRead();
/** Write iPayload to the remote device, completing this AO when finished. */
virtual void DoSendPayloadL() = 0;
/** Read KPayloadLen characters into iPayload, completing this AO when finished. */
virtual void DoLaunchRead() = 0;
protected:
/** Whether this transport is listening for an incoming payload. */
TBool iListening;
/** Buffer contains payload which is being sent to or received from the remote device. */
TBuf<KPayloadLen> iPayload;
/**
Observer to notify when transport events occur, and
which also raises dialogs during blocking operations.
*/
MTransportObserver& iObserver;
};
// -------- debugging --------
#ifdef _DEBUG
enum TTransPanicReason
/** Invalid states for the generic transport layer. */
{
ESpListening, //<<< Attempted to read payload when already reading.
ESpInvalidLength, //<<< Attempted to send payload with invalid length
};
void TransPanic(TTransPanicReason aReason);
#endif // #ifdef _DEBUG
// -------- app-specific error codes --------
/**
The supplied message was not a payload response. This error code
distinguishes not finding a message from an actual error such as
running out of memory.
*/
const TInt KErrOandXMessageNotFound = -20001;
#endif // #ifndef TRANSPORT_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -