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

📄 elementsengine.h

📁 最新官方例子,图形,描述副,基本控件,通讯协议,等等,
💻 H
字号:
#ifndef ELEMENTSENGINE_H
#define ELEMENTSENGINE_H
// INCLUDES

// System includes
#include <e32def.h>
#include <f32file.h>
#include <s32std.h>
#include <s32stor.h>

// User includes
#include "csvfileloaderobserver.h"
#include "chemicalelement.h"	//TElementType
// FORWARD DECLARATIONS
class CConsoleBase;
class CCsvFileLoader;
class CElementList;

// CLASS DECLARATION

/**
*
* @class	CElementsEngine elementsengine.h
* @brief	Class to encapsulate some simple testing of the element container class. It simply
*			loads in the data from three separate csv files, then once they've all loaded in
*			it performs some sorting and finding operations by way of a test.
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/
class CElementsEngine : public CBase, public MCsvFileLoaderObserver
	{
public:
	/**
	* Canonical NewLC factory function. Constructs a new instance of a CElementsEngine, and leaves a pointer to
	* it on the cleanup stack
	* @returns A pointer to the newly constructed CElementsEngine class, which is left on the cleanup stack.
	*/

	static CElementsEngine* NewLC(CConsoleBase& aConsole);

	/**
	* Canonical NewL factory function. Constructs a new instance of a CElementsEngine
	*
	* @returns A pointer to the newly constructed CElementsEngine class.
	*/

	static CElementsEngine* NewL(CConsoleBase& aConsole);

	/**
	* Destructor.
	*/

	~CElementsEngine();
	/**
	* Loads elements from separate files asynchronously.
	*/
	void LoadFromCsvFilesL();

private:
	CElementsEngine(CConsoleBase& aConsole);
	void ConstructL();
	void TestElementList();
	void TestElementListStreamingL();
	void CreateRootDictionaryL();
	void CreateStoreL();
	TStreamId WriteSpecificElementTypeToStoreL(CChemicalElement::TElementType aElementType) const;
	void WriteElementsToStoreL() const;
	void ReadElementsFromStoreL();
	void WriteRootDictionaryL() const;
	void Panic(TInt aReason);

private:	//from MCsvFileLoaderObserver
	void NotifyElementLoaded(TInt aNewElementIndex);
	void NotifyLoadCompleted(TInt aCompletionStatus, const CCsvFileLoader& aLoader);

private:	//data
	CElementList* iElementList;
	RFs iFs;
	CCsvFileLoader* iMetalsCsvFileLoader;
	CCsvFileLoader* iNonMetalsCsvFileLoader;
	CCsvFileLoader* iSemiMetalsCsvFileLoader;
	TInt iFilesCompleted;
	CConsoleBase& iConsole;
	CPersistentStore* iStore;
	CStreamDictionary* iRootDictionary;
	};
#endif	// #ifndef ELEMENTSENGINE_H

// End of File

⌨️ 快捷键说明

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