📄 smtclnr.h
字号:
// SmtClnr.h : interface and implementation of CSmartCleaner class
//
/////////////////////////////////////////////////////////////////////////////
// CSmartCleaner is responsible for the cleanup of the object associated with it
// during its destruction
// Written by : T. Kulathu Sarma
// This file is part of Singleton application to demonstrate the concept of Singleton classes.
// This file is provided "as is" with no expressed or implied warranty.
#ifndef _SMARTCLEANER
#define _SMARTCLEANER
class CSmartCleaner
{
// Constructor / Destructor
public :
CSmartCleaner( CObject * pObject = NULL ) : m_pObject( pObject ) { }
virtual ~CSmartCleaner()
{
// Step 1 - Cleanup m_pObject
if( m_pObject != NULL )
{
delete m_pObject;
}
}
// Get / Set pointer methods
public :
void SetObject( CObject * pObject )
{
m_pObject = pObject;
}
CObject * GetObject()
{
return m_pObject;
}
// Attributes
private :
CObject * m_pObject;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -