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

📄 threadaoengine.h

📁 Series_60_DP_1_0_2_0_Thread_And_Active_Objects_Example_v1_0 Symbian os S60线程与活动对象实例
💻 H
字号:
/*
* ============================================================================
*  Name     : CThreadAOEngine from ThreadAOEngine.h
*  Part of  : ThreadAO
*  Created  : 12.1.2005 by Forum Nokia
*  Description:
*    Handles thread creation and initialization.
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef __THREAD_AO_ENGINE_H__
#define __THREAD_AO_ENGINE_H__

// INCLUDES
#include "e32base.h" //CTimer
#include "badesca.h" // CDesCaRrayFlat
#include "SharedIntermediator.h"
#include "ThreadListener.h"

// FORWARD DECLARATIONS
class SharedIntermediator;

// CLASS DECLARATION

/**
*  CThreadAOEngine application engine class.
*/
class CThreadAOEngine 
	{
public: 

/*!
* NewL()
* 
* discussion Create new CThreadAOEngine object
*
* param aSMediator a Pointer to CSharedIntermediator. 
* return a pointer to the created instance of CThreadAOEngine
*/
	static CThreadAOEngine* NewL(CSharedIntermediator* aSMediator);

/*!
* NewLC()
*	 
*/
	static CThreadAOEngine* NewLC(CSharedIntermediator* aSMediator);

/*!
* Destructor
*	 
*/
	~CThreadAOEngine(void);

/*!
* StartL()
*
* discussion Create thread1 and start threadFunction. Checks that this has 
* been called only once.
*/
	void Start();

/*!
* Stop()
*
* discussion Stop thread1.  
*/
	void Stop();

/*!
* ExecuteThread()
*
* discussion Function for thread one. Thread one executes this function while it's running.
* param aPtr pointer to a resource.
*/
	static TInt ExecuteThreadOne(TAny *aPtr);

/*!
* CreateActiveScheduler()
*
* discussion Create ActiveScheduler for thread1. Thread1 needs scheduling, because
* it's using active objects and the framework won't implement scheduler
* for you.
* param aSMediator a Pointer to CSharedIntermediator.
*/
	static void CreateActiveScheduler(CSharedIntermediator* aSMediator);

private: //functions

/*!
* CreateThreadsL()
*
* discussion Initialize one thread and start it. 
*/
	void CreateThreadsL();

private: // Basic two-phase Symbian OS constructors

/*!
 * ConstructL()
 *
 */
	void ConstructL();

/*!
 * CThreadAOEngine()
 * 
 * discussion Default constructor.
 * param aSMediator a Pointer to CSharedIntermediator.
 */
	CThreadAOEngine(CSharedIntermediator* aSMediator);
	
private: // data members       
	
	// a handle for thread1
	RThread iThreadOne;

	// Create a new thread only once. True means that the thread has been created, 
	// false otherwise.
	TBool iCreatedThreads;

	// Shared intermediator. Transmits data between thread1 and the mainthread
	CSharedIntermediator* iSMediator;

	// Thread1 state listener. 
	CThreadListener* iListener;
	};

#endif // __THREAD_AO_ENGINE_H__

⌨️ 快捷键说明

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