Moved CIB class constructors from header file to .cpp files.

This commit is contained in:
Gunnar Beutner 2012-07-09 17:07:20 +02:00
parent 5f32319c02
commit b38a618ce7
8 changed files with 30 additions and 20 deletions

View File

@ -2,6 +2,13 @@
using namespace icinga; using namespace icinga;
Host::Host(const ConfigObject::Ptr& configObject)
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "host");
}
string Host::GetAlias(void) const string Host::GetAlias(void) const
{ {
string value; string value;

View File

@ -7,11 +7,7 @@ namespace icinga
class I2_CIB_API Host : public ConfigObjectAdapter class I2_CIB_API Host : public ConfigObjectAdapter
{ {
public: public:
Host(const ConfigObject::Ptr& configObject) Host(const ConfigObject::Ptr& configObject);
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "host");
}
static bool Exists(const string& name); static bool Exists(const string& name);
static Host GetByName(const string& name); static Host GetByName(const string& name);

View File

@ -2,6 +2,12 @@
using namespace icinga; using namespace icinga;
HostGroup::HostGroup(const ConfigObject::Ptr& configObject)
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "hostgroup");
}
string HostGroup::GetAlias(void) const string HostGroup::GetAlias(void) const
{ {
string value; string value;

View File

@ -7,11 +7,7 @@ namespace icinga
class I2_CIB_API HostGroup : public ConfigObjectAdapter class I2_CIB_API HostGroup : public ConfigObjectAdapter
{ {
public: public:
HostGroup(const ConfigObject::Ptr& configObject) HostGroup(const ConfigObject::Ptr& configObject);
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "hostgroup");
}
static bool Exists(const string& name); static bool Exists(const string& name);
static HostGroup GetByName(const string& name); static HostGroup GetByName(const string& name);

View File

@ -2,6 +2,12 @@
using namespace icinga; using namespace icinga;
Service::Service(const ConfigObject::Ptr& configObject)
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "service");
}
string Service::GetAlias(void) const string Service::GetAlias(void) const
{ {
string value; string value;

View File

@ -25,11 +25,7 @@ class ServiceStatusMessage;
class I2_CIB_API Service : public ConfigObjectAdapter class I2_CIB_API Service : public ConfigObjectAdapter
{ {
public: public:
Service(const ConfigObject::Ptr& configObject) Service(const ConfigObject::Ptr& configObject);
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "service");
}
static bool Exists(const string& name); static bool Exists(const string& name);
static Service GetByName(const string& name); static Service GetByName(const string& name);

View File

@ -2,6 +2,13 @@
using namespace icinga; using namespace icinga;
ServiceGroup::ServiceGroup(const ConfigObject::Ptr& configObject)
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "servicegroup");
}
string ServiceGroup::GetAlias(void) const string ServiceGroup::GetAlias(void) const
{ {
string value; string value;

View File

@ -7,11 +7,7 @@ namespace icinga
class I2_CIB_API ServiceGroup : public ConfigObjectAdapter class I2_CIB_API ServiceGroup : public ConfigObjectAdapter
{ {
public: public:
ServiceGroup(const ConfigObject::Ptr& configObject) ServiceGroup(const ConfigObject::Ptr& configObject);
: ConfigObjectAdapter(configObject)
{
assert(GetType() == "servicegroup");
}
static bool Exists(const string& name); static bool Exists(const string& name);
static ServiceGroup GetByName(const string& name); static ServiceGroup GetByName(const string& name);