#include "ido/dbvalue.h"
#include "icinga/hostgroup.h"
#include "base/objectlock.h"
+#include "base/initialize.h"
+#include "base/logger_fwd.h"
#include <boost/foreach.hpp>
using namespace icinga;
REGISTER_DBTYPE(HostGroup, "hostgroup", 3, "hostgroup_object_id", HostGroupDbObject);
+INITIALIZE_ONCE(HostGroupDbObject, &HostGroupDbObject::StaticInitialize);
HostGroupDbObject::HostGroupDbObject(const DbType::Ptr& type, const String& name1, const String& name2)
: DbObject(type, name1, name2)
{ }
+void HostGroupDbObject::StaticInitialize(void)
+{
+ HostGroup::OnMembersChanged.connect(&HostGroupDbObject::MembersChangedHandler);
+}
+
Dictionary::Ptr HostGroupDbObject::GetConfigFields(void) const
{
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
{
return Empty;
}
+
+void HostGroupDbObject::OnConfigUpdate(void)
+{
+ MembersChangedHandler();
+}
+
+void HostGroupDbObject::MembersChangedHandler(void)
+{
+ Log(LogWarning, "ido", "MOO");
+}
HostGroupDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
+ static void StaticInitialize(void);
+
virtual Dictionary::Ptr GetConfigFields(void) const;
virtual Dictionary::Ptr GetStatusFields(void) const;
+
+protected:
+ virtual void OnConfigUpdate(void);
+
+private:
+ static void MembersChangedHandler(void);
};
}