CMCore/inc/hgl/plugin/PlugIn.h

45 lines
1.2 KiB
C
Raw Normal View History

2019-08-23 17:11:24 +08:00
#ifndef HGL_PLUGIN_INCLUDE
#define HGL_PLUGIN_INCLUDE
#include<hgl/type/BaseString.h>
namespace hgl
2020-01-24 00:15:02 +08:00
{
2019-08-23 17:11:24 +08:00
/**
*
*/
class PlugIn ///插件
{
protected:
2020-01-24 00:15:02 +08:00
2019-08-23 17:11:24 +08:00
uint ref_count;
uint ver;
2019-08-27 20:26:44 +08:00
OSString name;
2019-08-23 17:11:24 +08:00
UTF16String intro;
OSString filename; ///<插件文件名
public:
const uint GetVersion ()const{return ver;} ///<取得插件版本
2019-08-27 20:26:44 +08:00
const OSString & GetName ()const{return name;} ///<取得插件名称
2019-08-23 17:11:24 +08:00
const UTF16String & GetIntro ()const{return intro;} ///<取得插件介绍
public:
PlugIn()
{
ref_count=0;
ver=0;
}
2020-01-24 00:15:02 +08:00
virtual ~PlugIn()=default;
2019-08-23 17:11:24 +08:00
uint add_ref(){return ++ref_count;}
uint release_ref(){return --ref_count;}
2019-08-27 20:26:44 +08:00
virtual bool GetInterface(uint,void *)=0;
2019-08-23 17:11:24 +08:00
};//class PlugIn
}//namespace hgl
#endif//HGL_PLUGIN_INCLUDE