Last active
May 15, 2021 12:10
-
-
Save artem78/499e78ef305ffcb5b20dce1b52bba717 to your computer and use it in GitHub Desktop.
Template of two-stage construction for C-class in Symbian OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CClassName* CClassName::NewLC() | |
{ | |
CClassName* self = new (ELeave) CClassName(); | |
CleanupStack::PushL(self); | |
self->ConstructL(); | |
return self; | |
} | |
CClassName* CClassName::NewL() | |
{ | |
CClassName* self = CClassName::NewLC(); | |
CleanupStack::Pop(); // self; | |
return self; | |
} | |
CClassName::CClassName() | |
{ | |
} | |
void CClassName::ConstructL() | |
{ | |
// ... Add your initialisation code here ... | |
} | |
CClassName::~CClassName() | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CClassName : public CBase | |
{ | |
// Constructor / Destructor | |
public: | |
static CClassName* NewL(); | |
static CClassName* NewLC(); | |
~CClassName(); | |
private: | |
CClassName(); | |
void ConstructL(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment