From 494fb90547bd9d80118cc894c7e031be7cf56d3e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 10 Oct 2013 23:07:05 +0200 Subject: [PATCH] Make sure Registry<> types are unique. --- lib/base/dynamictype.h | 2 +- lib/base/registry.h | 10 +++++----- lib/base/scriptfunction.h | 2 +- lib/base/scriptvariable.cpp | 2 +- lib/base/scriptvariable.h | 2 +- lib/config/configcompiler.h | 2 +- lib/config/configtype.cpp | 10 +++++----- lib/config/configtype.h | 2 +- lib/db_ido/dbtype.h | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/base/dynamictype.h b/lib/base/dynamictype.h index 5f48d971f..304fcd372 100644 --- a/lib/base/dynamictype.h +++ b/lib/base/dynamictype.h @@ -96,7 +96,7 @@ private: * * @ingroup base */ -class DynamicTypeRegistry : public Registry +class DynamicTypeRegistry : public Registry { }; /** diff --git a/lib/base/registry.h b/lib/base/registry.h index e8f4a77ce..552f8c32e 100644 --- a/lib/base/registry.h +++ b/lib/base/registry.h @@ -37,15 +37,15 @@ namespace icinga * * @ingroup base */ -template +template class Registry { public: typedef std::map ItemMap; - static Registry *GetInstance(void) + static Registry *GetInstance(void) { - return Singleton >::GetInstance(); + return Singleton >::GetInstance(); } void Register(const String& name, const T& item) @@ -82,7 +82,7 @@ public: void Clear(void) { - typename Registry::ItemMap items; + typename Registry::ItemMap items; { boost::mutex::scoped_lock lock(m_Mutex); @@ -125,7 +125,7 @@ public: private: mutable boost::mutex m_Mutex; - typename Registry::ItemMap m_Items; + typename Registry::ItemMap m_Items; }; } diff --git a/lib/base/scriptfunction.h b/lib/base/scriptfunction.h index 2c40261eb..e0299ad4d 100644 --- a/lib/base/scriptfunction.h +++ b/lib/base/scriptfunction.h @@ -55,7 +55,7 @@ private: * * @ingroup base */ -class I2_BASE_API ScriptFunctionRegistry : public Registry +class I2_BASE_API ScriptFunctionRegistry : public Registry { }; /** diff --git a/lib/base/scriptvariable.cpp b/lib/base/scriptvariable.cpp index 2bc3f7636..6d30e643e 100644 --- a/lib/base/scriptvariable.cpp +++ b/lib/base/scriptvariable.cpp @@ -22,7 +22,7 @@ using namespace icinga; -Registry ScriptVariable::m_Registry; +Registry ScriptVariable::m_Registry; Value ScriptVariable::Get(const String& name) { diff --git a/lib/base/scriptvariable.h b/lib/base/scriptvariable.h index cefa280ee..628c89026 100644 --- a/lib/base/scriptvariable.h +++ b/lib/base/scriptvariable.h @@ -39,7 +39,7 @@ public: static void Set(const String& name, const Value& value); private: - static Registry m_Registry; + static Registry m_Registry; }; } diff --git a/lib/config/configcompiler.h b/lib/config/configcompiler.h index de6a15a9a..d888ad5ec 100644 --- a/lib/config/configcompiler.h +++ b/lib/config/configcompiler.h @@ -78,7 +78,7 @@ private: void DestroyScanner(void); }; -class I2_CONFIG_API ConfigFragmentRegistry : public Registry +class I2_CONFIG_API ConfigFragmentRegistry : public Registry { }; /** diff --git a/lib/config/configtype.cpp b/lib/config/configtype.cpp index 2c0d90c1b..ca4fef596 100644 --- a/lib/config/configtype.cpp +++ b/lib/config/configtype.cpp @@ -282,20 +282,20 @@ void ConfigType::ValidateArray(const Array::Ptr& array, void ConfigType::Register(void) { - Registry::GetInstance()->Register(GetName(), GetSelf()); + Registry::GetInstance()->Register(GetName(), GetSelf()); } ConfigType::Ptr ConfigType::GetByName(const String& name) { - return Registry::GetInstance()->GetItem(name); + return Registry::GetInstance()->GetItem(name); } -Registry::ItemMap ConfigType::GetTypes(void) +Registry::ItemMap ConfigType::GetTypes(void) { - return Registry::GetInstance()->GetItems(); + return Registry::GetInstance()->GetItems(); } void ConfigType::DiscardTypes(void) { - Registry::GetInstance()->Clear(); + Registry::GetInstance()->Clear(); } diff --git a/lib/config/configtype.h b/lib/config/configtype.h index eab05ae8c..feedb0639 100644 --- a/lib/config/configtype.h +++ b/lib/config/configtype.h @@ -54,7 +54,7 @@ public: void Register(void); static ConfigType::Ptr GetByName(const String& name); - static Registry::ItemMap GetTypes(void); + static Registry::ItemMap GetTypes(void); static void DiscardTypes(void); private: diff --git a/lib/db_ido/dbtype.h b/lib/db_ido/dbtype.h index c5fe54186..282603df0 100644 --- a/lib/db_ido/dbtype.h +++ b/lib/db_ido/dbtype.h @@ -75,7 +75,7 @@ private: * * @ingroup ido */ -class DbTypeRegistry : public Registry +class DbTypeRegistry : public Registry { }; /**