⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 engine.h

📁 《SymbianOSC手机应用开发》源码
💻 H
字号:
// engine.h
//
// Copyright (c) 2000 Symbian Ltd.  All rights reserved.

#ifndef __ENGINE_H
#define __ENGINE_H

#include <e32base.h>
#include <s32std.h>
#include "gsdp.h"

class CGameEngine : public CBase
	{
public:
	enum TState { EBlank, EListening, EInitiating, EBound };
public:
	~CGameEngine();
	// interrogate
	TBool IsBlank() const;
	TBool IsListening() const;
	TBool IsInitiating() const;
	TBool IsBound() const;
	CGameEngine::TState State() const;
	TUid GetGdpProtocol() const; // get current protocol
	TUint32 MyPort() const;
	const TDesC& OtherAddress() const;
	TUint32 OtherPort() const;
	const TDesC& LastSent() const;
	const TDesC& LastReceived() const;
	// set - basic state
	void Reset(); // resets everything, including blank state, loopback protocol
	void SetGdpProtocol(TUid aGdpProtocol); // set current protocol
	void SetBoundL(TUint32 aMyPort, const TDesC& aOtherAddress, TUint32 aOtherPort);
	void SetInitiatingL(TUint32 aMyPort, const TDesC& aOtherAddress, const TDesC& aSentString);
	void BindAfterInitiatingL(TUint32 aOtherPort);
	void SetListeningL();
	void BindAfterListeningL(TUint32 aMyPort, const TDesC& aOtherAddress, TUint32 aOtherPort);
	// set - messages
	void SetLastSentL(const TDesC& aString);
	void SetLastReceivedL(const TDesC& aString);
	// persistence
	void ExternalizeL(RWriteStream& aStream) const;
	void InternalizeL(RReadStream& aStream);
	TStreamId StoreL(CStreamStore& aStore) const;
	void RestoreL(const CStreamStore& aStore, TStreamId aStreamId);
public: // should be private
	// set - addresses, stuff used only by higher-level calls
	void SetMyPort(TUint32 aPort);
	void SetOtherAddressL(const TDesC& aString);
	void SetOtherPort(TUint32 aPort);
private:
	// state variables
	TState iState; // engine state
	TUid iGdpProtocol;
	// session addresses
	TUint32 iMyPort;
	HBufC* iOtherAddress;
	TUint32 iOtherPort;
	// message log
	HBufC* iLastSent;
	HBufC* iLastReceived;
	};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -