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

📄 genericobject.h

📁 Many applications use connection/object pool. A program may require a IMAP connection pool and LDAP
💻 H
字号:
#ifndef GENERIC_OBJECT_H
#define GENERIC_OBJECT_H

/***********************************************************************
 * GenericObject.h
 * Rohit Joshi
 * 08-25/2004
 * This is sample Genric object class. User who implemented his object
 * class must have following methods defined or inherit from this class
 * Init() :      Initliaze the Object
 * Release():    Release the resources 
 * IsUsable():   Check if object is usable
 * MakeUsable(): Make the object usable. 
 ***********************************************************************/
class GenericObject
{
    public:
	    //constructor
	    GenericObject() {}
	    //destrctor
	    ~GenericObject() {}
		//Initliaze object
        virtual void Init() {}
		//Release the resource related to object
        virtual void Release() {}
        // Check if object is still usable
        virtual bool IsUsable()
        {
            return true;
        }
		// If object is not usable, make it usable
        virtual bool MakeUsable()
        {
            if(!IsUsable()) {
                Init();
            }
            return true;
        }
};
#endif // GENERIC_OBJECT_H

⌨️ 快捷键说明

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