123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef __PCL_LAZY_OBJECT__2005_04_03__H__
- #define __PCL_LAZY_OBJECT__2005_04_03__H__
- template<class T> class PCL_Interface_Lazy_Object ;
- template<class T>
- class PCL_Interface_Lazy_Object
- {
- public:
- PCL_Interface_Lazy_Object() : m_pObj(0) {}
- virtual ~PCL_Interface_Lazy_Object() {if(m_pObj) delete m_pObj;}
-
- T* PCL_GetLazyObject()
- {
- if (!m_pObj)
- {
- m_pObj = new T ;
- PCL_Initialize_Lazy_Object (m_pObj) ;
- }
- return m_pObj ;
- }
- protected:
-
- virtual void PCL_Initialize_Lazy_Object (T* pObj) {}
- private:
- T * m_pObj ;
- };
- #endif
|