英文语法修改Registry->Register
This commit is contained in:
@@ -73,10 +73,10 @@ namespace hgl::io
|
||||
virtual ~EventDispatch()
|
||||
{
|
||||
if(parent_input_event)
|
||||
parent_input_event->UnregistryEventDispatch(this);
|
||||
parent_input_event->UnregisterEventDispatch(this);
|
||||
}
|
||||
|
||||
virtual bool RegistryEventDispatch(EventDispatch *ie)
|
||||
virtual bool RegisterEventDispatch(EventDispatch *ie)
|
||||
{
|
||||
if(!ie)
|
||||
return(false);
|
||||
@@ -91,7 +91,7 @@ namespace hgl::io
|
||||
return(event_dispatch_subscribers.Add(ie)!=-1);
|
||||
}
|
||||
|
||||
bool UnregistryEventDispatch(EventDispatch *ie)
|
||||
bool UnregisterEventDispatch(EventDispatch *ie)
|
||||
{
|
||||
if(!ie)return(false);
|
||||
|
||||
|
@@ -20,8 +20,8 @@ namespace hgl
|
||||
PlugInManage(const OSString &n);
|
||||
virtual ~PlugInManage()=default;
|
||||
|
||||
bool RegistryPlugin(PlugIn *); ///<注册一个内置插件
|
||||
uint UnregistryPlugin(const OSString &); ///<释放一个内置插件
|
||||
bool RegisterPlugin(PlugIn *); ///<注册一个内置插件
|
||||
uint UnregisterPlugin(const OSString &); ///<释放一个内置插件
|
||||
|
||||
bool AddFindPath (const OSString &path); ///<添加一个插件查找目录
|
||||
|
||||
@@ -33,24 +33,24 @@ namespace hgl
|
||||
/**
|
||||
* 插件注册模板
|
||||
*/
|
||||
template<typename T> class RegistryPlugInProxy
|
||||
template<typename T> class RegisterPlugInProxy
|
||||
{
|
||||
T *plugin;
|
||||
|
||||
public:
|
||||
|
||||
RegistryPlugInProxy()
|
||||
RegisterPlugInProxy()
|
||||
{
|
||||
plugin=new T;
|
||||
}
|
||||
|
||||
virtual ~RegistryPlugInProxy()
|
||||
virtual ~RegisterPlugInProxy()
|
||||
{
|
||||
delete plugin;
|
||||
}
|
||||
|
||||
T *get(){return plugin;}
|
||||
};//template<typename T> class RegistryPlugInProxy
|
||||
};//template<typename T> class RegisterPlugInProxy
|
||||
|
||||
/*
|
||||
如Log插件中的Console,File插件,是直接在代码中的,属于内部插件。
|
||||
@@ -58,11 +58,11 @@ namespace hgl
|
||||
*/
|
||||
|
||||
#ifndef __MAKE_PLUGIN__ //内部插件
|
||||
#define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy<name,classname> plugin_proxy_##classname; \
|
||||
extern "C" void registry_plugin_##classname;
|
||||
#define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy<name,classname> plugin_proxy_##classname; \
|
||||
extern "C" void register_plugin_##classname;
|
||||
#else //外部插件
|
||||
#define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy<name,classname> plugin_proxy_##classname \
|
||||
extern "C" void registry_plugin_##name(void)
|
||||
#define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy<name,classname> plugin_proxy_##classname \
|
||||
extern "C" void register_plugin_##name(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
namespace hgl
|
||||
{
|
||||
template<typename T,typename SC>
|
||||
bool RegistryIDName(ConstStringView<SC> &csv,const SC *name_string,const int name_length)
|
||||
bool RegisterIDName(ConstStringView<SC> &csv,const SC *name_string,const int name_length)
|
||||
{
|
||||
static ConstStringSet<SC> *id_name_set=nullptr;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace hgl
|
||||
return;
|
||||
}
|
||||
|
||||
RegistryIDName<MANAGER,SC>(csv,name_string,name_length);
|
||||
RegisterIDName<MANAGER,SC>(csv,name_string,name_length);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include<hgl/type/DataType.h>
|
||||
#include<hgl/type/object/ObjectBaseInfo.h>
|
||||
#include<source_location>
|
||||
@@ -18,7 +18,7 @@ namespace hgl
|
||||
|
||||
tsl::robin_map<size_t,void *> inherit_class_map; ///<继承类的hash值与this指针的映射表
|
||||
|
||||
bool RegistryInheritClass(const size_t &hash_code,void *class_this)noexcept
|
||||
bool RegisterInheritClass(const size_t &hash_code,void *class_this)noexcept
|
||||
{
|
||||
if(inherit_class_map.find(hash_code)!=inherit_class_map.end())
|
||||
return(false);
|
||||
@@ -28,9 +28,9 @@ namespace hgl
|
||||
return(true);
|
||||
}
|
||||
|
||||
template<typename T> bool RegistryInheritClass(T *class_this)noexcept
|
||||
template<typename T> bool RegisterInheritClass(T *class_this)noexcept
|
||||
{
|
||||
return RegistryInheritClass(hgl::GetTypeHash<T>(),class_this);
|
||||
return RegisterInheritClass(hgl::GetTypeHash<T>(),class_this);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<source_location>
|
||||
#include<typeinfo>
|
||||
@@ -23,7 +23,7 @@ namespace hgl
|
||||
size_t count;
|
||||
};
|
||||
|
||||
void RegistryObjectTypeInfo(const size_t &hash_code,const std::type_info *);
|
||||
void RegisterObjectTypeInfo(const size_t &hash_code,const std::type_info *);
|
||||
|
||||
const ObjectTypeInfo *GetObjectTypeInfoByHash(const size_t &hash_code);
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include<hgl/type/object/ObjectBaseInfo.h>
|
||||
#include<hgl/type/object/ObjectBaseInfo.h>
|
||||
#include<tsl/robin_map.h>
|
||||
#include<typeinfo>
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace hgl
|
||||
tsl::robin_map<size_t,ObjectTypeInfo *> type_info_map;
|
||||
}//namespace
|
||||
|
||||
void RegistryObjectTypeInfo(const size_t &hash_code,const std::type_info *info)
|
||||
void RegisterObjectTypeInfo(const size_t &hash_code,const std::type_info *info)
|
||||
{
|
||||
if(!info)
|
||||
return;
|
||||
|
@@ -28,7 +28,7 @@ namespace hgl
|
||||
}
|
||||
}
|
||||
|
||||
bool PlugInManage::RegistryPlugin(PlugIn *pi)
|
||||
bool PlugInManage::RegisterPlugin(PlugIn *pi)
|
||||
{
|
||||
if(!pi)return(false);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace hgl
|
||||
return this->Add(pi_name,pi);
|
||||
}
|
||||
|
||||
uint PlugInManage::UnregistryPlugin(const OSString &pi_name)
|
||||
uint PlugInManage::UnregisterPlugin(const OSString &pi_name)
|
||||
{
|
||||
PlugIn *pi=this->Find(pi_name);
|
||||
|
||||
|
Reference in New Issue
Block a user