From a8972e78f8ef964a4106d3d78db674a6b04ded29 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 9 Sep 2013 15:54:32 +0200 Subject: [PATCH] ido: Clean up obsolete handlers. --- lib/ido/dbconnection.cpp | 2 -- lib/ido/dbobject.cpp | 33 --------------------------------- lib/ido/dbobject.h | 4 ---- 3 files changed, 39 deletions(-) diff --git a/lib/ido/dbconnection.cpp b/lib/ido/dbconnection.cpp index 4c6e790e8..0a5ffcaa5 100644 --- a/lib/ido/dbconnection.cpp +++ b/lib/ido/dbconnection.cpp @@ -37,8 +37,6 @@ void DbConnection::Start(void) { DynamicObject::Start(); - DbObject::OnRegistered.connect(boost::bind(&DbConnection::ActivateObject, this, _1)); - DbObject::OnUnregistered.connect(boost::bind(&DbConnection::DeactivateObject, this, _1)); DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1)); } diff --git a/lib/ido/dbobject.cpp b/lib/ido/dbobject.cpp index 50291f6eb..0bd6fa88a 100644 --- a/lib/ido/dbobject.cpp +++ b/lib/ido/dbobject.cpp @@ -30,8 +30,6 @@ using namespace icinga; -boost::signals2::signal DbObject::OnRegistered; -boost::signals2::signal DbObject::OnUnregistered; boost::signals2::signal DbObject::OnQuery; INITIALIZE_ONCE(DbObject, &DbObject::StaticInitialize); @@ -42,9 +40,6 @@ DbObject::DbObject(const shared_ptr& type, const String& name1, const St void DbObject::StaticInitialize(void) { - DynamicObject::OnStarted.connect(boost::bind(&DbObject::ObjectStartedHandler, _1)); - DynamicObject::OnStopped.connect(boost::bind(&DbObject::ObjectStoppedHandler, _1)); - DynamicObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1)); } @@ -188,34 +183,6 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object) return dbobj; } -void DbObject::ObjectStartedHandler(const DynamicObject::Ptr& object) -{ - DbObject::Ptr dbobj = GetOrCreateByObject(object); - - if (!dbobj) - return; - - OnRegistered(dbobj); - - dbobj->SendConfigUpdate(); - dbobj->SendStatusUpdate(); -} - -void DbObject::ObjectStoppedHandler(const DynamicObject::Ptr& object) -{ - DbObject::Ptr dbobj = GetOrCreateByObject(object); - - if (!dbobj) - return; - - OnUnregistered(dbobj); - - { - ObjectLock olock(object); - object->ClearExtension("DbObject"); - } -} - void DbObject::StateChangedHandler(const DynamicObject::Ptr& object) { DbObject::Ptr dbobj = GetOrCreateByObject(object); diff --git a/lib/ido/dbobject.h b/lib/ido/dbobject.h index 36ce3b921..e3a6b3d7f 100644 --- a/lib/ido/dbobject.h +++ b/lib/ido/dbobject.h @@ -75,8 +75,6 @@ public: static DbObject::Ptr GetOrCreateByObject(const DynamicObject::Ptr& object); - static boost::signals2::signal OnRegistered; - static boost::signals2::signal OnUnregistered; static boost::signals2::signal OnQuery; void SendConfigUpdate(void); @@ -101,8 +99,6 @@ private: double m_LastConfigUpdate; double m_LastStatusUpdate; - static void ObjectStartedHandler(const DynamicObject::Ptr& object); - static void ObjectStoppedHandler(const DynamicObject::Ptr& object); static void StateChangedHandler(const DynamicObject::Ptr& object); friend class DbType;