ido: Clean up obsolete handlers.

This commit is contained in:
Gunnar Beutner 2013-09-09 15:54:32 +02:00
parent cf3298f130
commit a8972e78f8
3 changed files with 0 additions and 39 deletions

View File

@ -37,8 +37,6 @@ void DbConnection::Start(void)
{ {
DynamicObject::Start(); 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)); DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
} }

View File

@ -30,8 +30,6 @@
using namespace icinga; using namespace icinga;
boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnRegistered;
boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnUnregistered;
boost::signals2::signal<void (const DbQuery&)> DbObject::OnQuery; boost::signals2::signal<void (const DbQuery&)> DbObject::OnQuery;
INITIALIZE_ONCE(DbObject, &DbObject::StaticInitialize); INITIALIZE_ONCE(DbObject, &DbObject::StaticInitialize);
@ -42,9 +40,6 @@ DbObject::DbObject(const shared_ptr<DbType>& type, const String& name1, const St
void DbObject::StaticInitialize(void) 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)); DynamicObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
} }
@ -188,34 +183,6 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object)
return dbobj; 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) void DbObject::StateChangedHandler(const DynamicObject::Ptr& object)
{ {
DbObject::Ptr dbobj = GetOrCreateByObject(object); DbObject::Ptr dbobj = GetOrCreateByObject(object);

View File

@ -75,8 +75,6 @@ public:
static DbObject::Ptr GetOrCreateByObject(const DynamicObject::Ptr& object); static DbObject::Ptr GetOrCreateByObject(const DynamicObject::Ptr& object);
static boost::signals2::signal<void (const DbObject::Ptr&)> OnRegistered;
static boost::signals2::signal<void (const DbObject::Ptr&)> OnUnregistered;
static boost::signals2::signal<void (const DbQuery&)> OnQuery; static boost::signals2::signal<void (const DbQuery&)> OnQuery;
void SendConfigUpdate(void); void SendConfigUpdate(void);
@ -101,8 +99,6 @@ private:
double m_LastConfigUpdate; double m_LastConfigUpdate;
double m_LastStatusUpdate; double m_LastStatusUpdate;
static void ObjectStartedHandler(const DynamicObject::Ptr& object);
static void ObjectStoppedHandler(const DynamicObject::Ptr& object);
static void StateChangedHandler(const DynamicObject::Ptr& object); static void StateChangedHandler(const DynamicObject::Ptr& object);
friend class DbType; friend class DbType;