英文语法修改Registry->Register

This commit is contained in:
2025-07-03 10:15:02 +08:00
parent f6c50e29d9
commit 25060b07d0
7 changed files with 25 additions and 25 deletions

View File

@@ -73,10 +73,10 @@ namespace hgl::io
virtual ~EventDispatch() virtual ~EventDispatch()
{ {
if(parent_input_event) 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) if(!ie)
return(false); return(false);
@@ -91,7 +91,7 @@ namespace hgl::io
return(event_dispatch_subscribers.Add(ie)!=-1); return(event_dispatch_subscribers.Add(ie)!=-1);
} }
bool UnregistryEventDispatch(EventDispatch *ie) bool UnregisterEventDispatch(EventDispatch *ie)
{ {
if(!ie)return(false); if(!ie)return(false);

View File

@@ -20,8 +20,8 @@ namespace hgl
PlugInManage(const OSString &n); PlugInManage(const OSString &n);
virtual ~PlugInManage()=default; virtual ~PlugInManage()=default;
bool RegistryPlugin(PlugIn *); ///<注册一个内置插件 bool RegisterPlugin(PlugIn *); ///<注册一个内置插件
uint UnregistryPlugin(const OSString &); ///<释放一个内置插件 uint UnregisterPlugin(const OSString &); ///<释放一个内置插件
bool AddFindPath (const OSString &path); ///<添加一个插件查找目录 bool AddFindPath (const OSString &path); ///<添加一个插件查找目录
@@ -33,24 +33,24 @@ namespace hgl
/** /**
* 插件注册模板 * 插件注册模板
*/ */
template<typename T> class RegistryPlugInProxy template<typename T> class RegisterPlugInProxy
{ {
T *plugin; T *plugin;
public: public:
RegistryPlugInProxy() RegisterPlugInProxy()
{ {
plugin=new T; plugin=new T;
} }
virtual ~RegistryPlugInProxy() virtual ~RegisterPlugInProxy()
{ {
delete plugin; delete plugin;
} }
T *get(){return plugin;} T *get(){return plugin;}
};//template<typename T> class RegistryPlugInProxy };//template<typename T> class RegisterPlugInProxy
/* /*
如Log插件中的Console,File插件是直接在代码中的属于内部插件。 如Log插件中的Console,File插件是直接在代码中的属于内部插件。
@@ -58,11 +58,11 @@ namespace hgl
*/ */
#ifndef __MAKE_PLUGIN__ //内部插件 #ifndef __MAKE_PLUGIN__ //内部插件
#define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy<name,classname> plugin_proxy_##classname; \ #define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy<name,classname> plugin_proxy_##classname; \
extern "C" void registry_plugin_##classname; extern "C" void register_plugin_##classname;
#else //外部插件 #else //外部插件
#define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy<name,classname> plugin_proxy_##classname \ #define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy<name,classname> plugin_proxy_##classname \
extern "C" void registry_plugin_##name(void) extern "C" void register_plugin_##name(void)
{ {
} }

View File

@@ -6,7 +6,7 @@
namespace hgl namespace hgl
{ {
template<typename T,typename SC> 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; static ConstStringSet<SC> *id_name_set=nullptr;
@@ -47,7 +47,7 @@ namespace hgl
return; return;
} }
RegistryIDName<MANAGER,SC>(csv,name_string,name_length); RegisterIDName<MANAGER,SC>(csv,name_string,name_length);
} }
public: public:

View File

@@ -1,4 +1,4 @@
#pragma once #pragma once
#include<hgl/type/DataType.h> #include<hgl/type/DataType.h>
#include<hgl/type/object/ObjectBaseInfo.h> #include<hgl/type/object/ObjectBaseInfo.h>
#include<source_location> #include<source_location>
@@ -18,7 +18,7 @@ namespace hgl
tsl::robin_map<size_t,void *> inherit_class_map; ///<继承类的hash值与this指针的映射表 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()) if(inherit_class_map.find(hash_code)!=inherit_class_map.end())
return(false); return(false);
@@ -28,9 +28,9 @@ namespace hgl
return(true); 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: public:

View File

@@ -1,4 +1,4 @@
#pragma once #pragma once
#include<source_location> #include<source_location>
#include<typeinfo> #include<typeinfo>
@@ -23,7 +23,7 @@ namespace hgl
size_t count; 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); const ObjectTypeInfo *GetObjectTypeInfoByHash(const size_t &hash_code);

View File

@@ -1,4 +1,4 @@
#include<hgl/type/object/ObjectBaseInfo.h> #include<hgl/type/object/ObjectBaseInfo.h>
#include<tsl/robin_map.h> #include<tsl/robin_map.h>
#include<typeinfo> #include<typeinfo>
@@ -9,7 +9,7 @@ namespace hgl
tsl::robin_map<size_t,ObjectTypeInfo *> type_info_map; tsl::robin_map<size_t,ObjectTypeInfo *> type_info_map;
}//namespace }//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) if(!info)
return; return;

View File

@@ -28,7 +28,7 @@ namespace hgl
} }
} }
bool PlugInManage::RegistryPlugin(PlugIn *pi) bool PlugInManage::RegisterPlugin(PlugIn *pi)
{ {
if(!pi)return(false); if(!pi)return(false);
@@ -40,7 +40,7 @@ namespace hgl
return this->Add(pi_name,pi); 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); PlugIn *pi=this->Find(pi_name);