From 25060b07d03d088b940f78ac1223f4888377f608 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 3 Jul 2025 10:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E6=96=87=E8=AF=AD=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9Registry->Register?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/io/event/EventDispatch.h | 6 +++--- inc/hgl/plugin/PlugInManage.h | 20 ++++++++++---------- inc/hgl/type/IDName.h | 4 ++-- inc/hgl/type/object/Object.h | 8 ++++---- inc/hgl/type/object/ObjectBaseInfo.h | 4 ++-- src/Object/ObjectBaseInfo.cpp | 4 ++-- src/PlugIn/PlugInManage.cpp | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/inc/hgl/io/event/EventDispatch.h b/inc/hgl/io/event/EventDispatch.h index 519d34d..40a9de0 100644 --- a/inc/hgl/io/event/EventDispatch.h +++ b/inc/hgl/io/event/EventDispatch.h @@ -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); diff --git a/inc/hgl/plugin/PlugInManage.h b/inc/hgl/plugin/PlugInManage.h index b9ef7b5..a87a820 100644 --- a/inc/hgl/plugin/PlugInManage.h +++ b/inc/hgl/plugin/PlugInManage.h @@ -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 class RegistryPlugInProxy + template class RegisterPlugInProxy { T *plugin; public: - RegistryPlugInProxy() + RegisterPlugInProxy() { plugin=new T; } - virtual ~RegistryPlugInProxy() + virtual ~RegisterPlugInProxy() { delete plugin; } T *get(){return plugin;} - };//template class RegistryPlugInProxy + };//template class RegisterPlugInProxy /* 如Log插件中的Console,File插件,是直接在代码中的,属于内部插件。 @@ -58,11 +58,11 @@ namespace hgl */ #ifndef __MAKE_PLUGIN__ //内部插件 - #define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy plugin_proxy_##classname; \ - extern "C" void registry_plugin_##classname; + #define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy plugin_proxy_##classname; \ + extern "C" void register_plugin_##classname; #else //外部插件 - #define REGISTRY_PLUG_IN(name,classname) static RegistryPlugInProxy plugin_proxy_##classname \ - extern "C" void registry_plugin_##name(void) + #define REGISTER_PLUG_IN(name,classname) static RegisterPlugInProxy plugin_proxy_##classname \ + extern "C" void register_plugin_##name(void) { } diff --git a/inc/hgl/type/IDName.h b/inc/hgl/type/IDName.h index a68138c..628e9a3 100644 --- a/inc/hgl/type/IDName.h +++ b/inc/hgl/type/IDName.h @@ -6,7 +6,7 @@ namespace hgl { template - bool RegistryIDName(ConstStringView &csv,const SC *name_string,const int name_length) + bool RegisterIDName(ConstStringView &csv,const SC *name_string,const int name_length) { static ConstStringSet *id_name_set=nullptr; @@ -47,7 +47,7 @@ namespace hgl return; } - RegistryIDName(csv,name_string,name_length); + RegisterIDName(csv,name_string,name_length); } public: diff --git a/inc/hgl/type/object/Object.h b/inc/hgl/type/object/Object.h index d324a39..fde6180 100644 --- a/inc/hgl/type/object/Object.h +++ b/inc/hgl/type/object/Object.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include #include @@ -18,7 +18,7 @@ namespace hgl tsl::robin_map 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 bool RegistryInheritClass(T *class_this)noexcept + template bool RegisterInheritClass(T *class_this)noexcept { - return RegistryInheritClass(hgl::GetTypeHash(),class_this); + return RegisterInheritClass(hgl::GetTypeHash(),class_this); } public: diff --git a/inc/hgl/type/object/ObjectBaseInfo.h b/inc/hgl/type/object/ObjectBaseInfo.h index b86e482..9a407dc 100644 --- a/inc/hgl/type/object/ObjectBaseInfo.h +++ b/inc/hgl/type/object/ObjectBaseInfo.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -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); diff --git a/src/Object/ObjectBaseInfo.cpp b/src/Object/ObjectBaseInfo.cpp index 3cba226..4d56150 100644 --- a/src/Object/ObjectBaseInfo.cpp +++ b/src/Object/ObjectBaseInfo.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -9,7 +9,7 @@ namespace hgl tsl::robin_map 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; diff --git a/src/PlugIn/PlugInManage.cpp b/src/PlugIn/PlugInManage.cpp index 0b6a512..6299969 100644 --- a/src/PlugIn/PlugInManage.cpp +++ b/src/PlugIn/PlugInManage.cpp @@ -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);