📄 resmanagement.h
字号:
/**
*
* TObject ResManagement.h
* This class is a simple TClass with limited functionality.
* It's used in conjunction with
* CResManagement to demonstrate the scoping ideas
*
* Copyright (c) 2004 Nokia Corporation
* version 2.0
*/
#ifndef __RESMANAGEMENT_H__
#define __RESMANAGEMENT_H__
// INCLUDES
#include <e32base.h>
// FORWARD DECLARATIONS
class TParsePtrC;
class TObject
{
public:
TObject();
public:
void SetMaxCapacityTask1(TInt aMaxCapTask1);
void SetMaxCapacityTask2(TInt aMaxCapTask2);
TInt MaxCapacityTask1() const;
TInt MaxCapacityTask2() const;
private:
TInt iMaxCapacityTask1;
TInt iMaxCapacityTask2;
};
//inline functions
// TObject Constructor
inline TObject::TObject():iMaxCapacityTask1(0),iMaxCapacityTask2(0){};
// Simple getters and setters
inline TInt TObject::MaxCapacityTask1() const { return iMaxCapacityTask1;}
inline TInt TObject::MaxCapacityTask2() const { return iMaxCapacityTask2;}
inline void TObject::SetMaxCapacityTask1(TInt aMaxCapTask1) {iMaxCapacityTask1 = aMaxCapTask1;}
inline void TObject::SetMaxCapacityTask2(TInt aMaxCapTask2) {iMaxCapacityTask2 = aMaxCapTask2;}
// CLASS DECLARATION
/**
*
* CResManagement ResManagement.h
* This class is used to illustrate some resource management tips
*
* Copyright (c) 2004 Nokia Corporation
* version 2.0
*/
class CResManagement : public CBase
{
public: // CResManagement and destruction.
/**
* Function: NewL
* Description: Creates instance of CResManagement object
* Returns: Instance of this class
*/
static CResManagement* NewL();
/**
* Function: ~CResManagement
* Description: Destroys CResManagement object
*/
~CResManagement();
public: // Methods.
/**
* Function: ScopingNotImplementedL
* Description: his function shows an implementaion that has not taken advantage
* of scoping. Note the function is not meant to be meaningful
* - it should just be compared to ScopingImplementedL
* to show how scoping can be implemented
*/
void ScopingNotImplementedL();
/**
* Function: ScopingImplementedL
* Description: This function shows an implementaion that has taken advantage
* of scoping. Note the function is not meant to be meaningful
* - it should just be compared to ScopingNotImplementedL
* to show how scoping can be implemented
*/
void ScopingImplementedL();
/**
* Function: ConstructFileNameL
* Description: This function gets the current app name then
* constructs a new filename by replacing the filetype
* extension with .mbm
*/
void ConstructFileNameL() const;
private: // Construction.
/**
* Function: CResManagement
* Description: Constructor
*/
CResManagement();
/**
* Function: ConstructL
* Description: 2nd phase construction
*/
void ConstructL();
/**
* Function: GetTotal
* Description: Sets values for two objects and combines them to get a value for
* the object passed in.
* The purpose of this function is just to
* demonstrate the idea of scoping
*
* Params: aObject. The object to assign values to
*/
void GetTotal(TObject& aObject);
/**
* Function: SetValues
* Description: Sets maximum capacity values for the objects passed in
*
* Params: aObject1, aObject2. Object to assign values to
*/
void SetValues(TObject& aObject1, TObject& aObject2);
/**
* Function: SetValues
* Description: Combines the values of the two objects passed and assigns them to
* another object
*
* Params: aObject1, aObject2. Object to combine values of
* Returns: TObject - values set as a result of combing values of objects
* passed in
*/
TObject CombineValues(TObject& aObject1, TObject& aOject2);
/**
* Function: CurrentStackPositionL
* Description: This function displays the current stack position of an object
* It can be used to check that scoping is more efficient
*
* Params: aObject3 Object to display address of
*/
void CurrentStackPositionL(TObject aObject3);
};
#endif // __RESMANAGEMENT_H__
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -