?? datagramservice.h
字號(hào):
// DatagramService.h
//
// Copyright (c) 2003 Symbian Ltd. All rights reserved.
//
#ifndef __DATAGRAMSERVICE_H__
#define __DATAGRAMSERVICE_H__
#include <e32base.h>
#include <e32std.h>
/** DatagramService ECOM UID */
const TUid KDatagramServiceInterfaceUID = {0x101FA9C1};
// Forward Declarations
class CDatagram;
/* class CDatagramService
*/
class CDatagramService : public CBase
/**
@publishedAll
Creates an appropriate CDatagramService derived object via ECOM
Comments : A generic Datagram Service API. Users of CDatagramService derived
classes must use an active scheduler/active object when using asynchronous
versions of the Send and Receieve functions.
*/
{
public:
// ECOM Specific
IMPORT_C static CDatagramService* NewL(const TUid aImplementationUid);
inline TUid Uid() const {return iDtor_ID_Key;};
IMPORT_C virtual void SendL(CDatagram* aDatagram, TRequestStatus& aStatus)=0;
/**
Send a Datagram asynchronously. Requires an active scheduler
@param aDatagram CDatagram to be sent via the CDatagramService
@param aStatus TRequestStatus notified of Send completion
*/
IMPORT_C virtual void ReceiveL(CDatagram* aDatagram, const TDesC8& aRecvParams, TRequestStatus& aStatus)=0;
/**
Receive a Datagram asynchronously. Requires an active scheduler
@param aDatagram CDatagram which will be populated by CDatagramService
@param aRecvParams Paramaters required for identification of incoming messages.
Specific to each Datagram Service
@param aStatus TRequestStatus notified of Receive completion
*/
protected:
IMPORT_C CDatagramService();
/** ECOM Instance key idenfifier*/
TUid iDtor_ID_Key;
private:
IMPORT_C CDatagramService(const CDatagramService& );
};
/* class CDatagram
Send and Receive data storage
*/
class CDatagram : public CBase
/**
@publishedAll
Comments : The API for a single datagram to be sent via a Datagram Service, or as a receptical
for an incoming datagram. .
*/
{
public:
IMPORT_C static CDatagram* NewL(TDesC8& aBuf);
IMPORT_C static CDatagram* NewL(const TDesC8& aBuf, const TDesC8& aAddress);
IMPORT_C virtual ~CDatagram();
// Accessors/mutators
IMPORT_C virtual const TDesC8& GetAddress();
IMPORT_C virtual void SetAddressL(const TDesC8& aAddress);
IMPORT_C virtual const TDesC8& GetData();
IMPORT_C virtual void SetDataL(const TDesC8& aData);
private:
void ConstructL(const TDesC8& aBuf);
private:
/** Buffer for the incoming outgoing message */
HBufC8* iData;
/** Buffer for the outgoing address */
HBufC8* iAddress;
};
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -