diff --git a/cib/host.cpp b/cib/host.cpp index de2787d92..df59f519d 100644 --- a/cib/host.cpp +++ b/cib/host.cpp @@ -2,6 +2,13 @@ using namespace icinga; +Host::Host(const ConfigObject::Ptr& configObject) + : ConfigObjectAdapter(configObject) +{ + assert(GetType() == "host"); +} + + string Host::GetAlias(void) const { string value; diff --git a/cib/host.h b/cib/host.h index 156aaeefa..3c5d5e077 100644 --- a/cib/host.h +++ b/cib/host.h @@ -7,11 +7,7 @@ namespace icinga class I2_CIB_API Host : public ConfigObjectAdapter { public: - Host(const ConfigObject::Ptr& configObject) - : ConfigObjectAdapter(configObject) - { - assert(GetType() == "host"); - } + Host(const ConfigObject::Ptr& configObject); static bool Exists(const string& name); static Host GetByName(const string& name); diff --git a/cib/hostgroup.cpp b/cib/hostgroup.cpp index 90ceb8875..9e6e74dc9 100644 --- a/cib/hostgroup.cpp +++ b/cib/hostgroup.cpp @@ -2,6 +2,12 @@ using namespace icinga; +HostGroup::HostGroup(const ConfigObject::Ptr& configObject) + : ConfigObjectAdapter(configObject) +{ + assert(GetType() == "hostgroup"); +} + string HostGroup::GetAlias(void) const { string value; diff --git a/cib/hostgroup.h b/cib/hostgroup.h index 025c1a819..7dda66ff6 100644 --- a/cib/hostgroup.h +++ b/cib/hostgroup.h @@ -7,11 +7,7 @@ namespace icinga class I2_CIB_API HostGroup : public ConfigObjectAdapter { public: - HostGroup(const ConfigObject::Ptr& configObject) - : ConfigObjectAdapter(configObject) - { - assert(GetType() == "hostgroup"); - } + HostGroup(const ConfigObject::Ptr& configObject); static bool Exists(const string& name); static HostGroup GetByName(const string& name); diff --git a/cib/service.cpp b/cib/service.cpp index 5bf8092d7..6f811be21 100644 --- a/cib/service.cpp +++ b/cib/service.cpp @@ -2,6 +2,12 @@ using namespace icinga; +Service::Service(const ConfigObject::Ptr& configObject) + : ConfigObjectAdapter(configObject) +{ + assert(GetType() == "service"); +} + string Service::GetAlias(void) const { string value; diff --git a/cib/service.h b/cib/service.h index 1cd51332e..499e7acc3 100644 --- a/cib/service.h +++ b/cib/service.h @@ -25,11 +25,7 @@ class ServiceStatusMessage; class I2_CIB_API Service : public ConfigObjectAdapter { public: - Service(const ConfigObject::Ptr& configObject) - : ConfigObjectAdapter(configObject) - { - assert(GetType() == "service"); - } + Service(const ConfigObject::Ptr& configObject); static bool Exists(const string& name); static Service GetByName(const string& name); diff --git a/cib/servicegroup.cpp b/cib/servicegroup.cpp index 39363f0a4..057379417 100644 --- a/cib/servicegroup.cpp +++ b/cib/servicegroup.cpp @@ -2,6 +2,13 @@ using namespace icinga; +ServiceGroup::ServiceGroup(const ConfigObject::Ptr& configObject) + : ConfigObjectAdapter(configObject) +{ + assert(GetType() == "servicegroup"); +} + + string ServiceGroup::GetAlias(void) const { string value; diff --git a/cib/servicegroup.h b/cib/servicegroup.h index 51cd09111..5b13a75b5 100644 --- a/cib/servicegroup.h +++ b/cib/servicegroup.h @@ -7,11 +7,7 @@ namespace icinga class I2_CIB_API ServiceGroup : public ConfigObjectAdapter { public: - ServiceGroup(const ConfigObject::Ptr& configObject) - : ConfigObjectAdapter(configObject) - { - assert(GetType() == "servicegroup"); - } + ServiceGroup(const ConfigObject::Ptr& configObject); static bool Exists(const string& name); static ServiceGroup GetByName(const string& name);