mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Verify object type in the CIB class constructors.
This commit is contained in:
parent
0032e32026
commit
c7788f73c2
@ -9,7 +9,9 @@ class I2_CIB_API Host : public ConfigObjectAdapter
|
||||
public:
|
||||
Host(const ConfigObject::Ptr& configObject)
|
||||
: ConfigObjectAdapter(configObject)
|
||||
{ }
|
||||
{
|
||||
assert(GetType() == "host");
|
||||
}
|
||||
|
||||
static bool Exists(const string& name);
|
||||
static Host GetByName(const string& name);
|
||||
|
@ -9,7 +9,9 @@ class I2_CIB_API HostGroup : public ConfigObjectAdapter
|
||||
public:
|
||||
HostGroup(const ConfigObject::Ptr& configObject)
|
||||
: ConfigObjectAdapter(configObject)
|
||||
{ }
|
||||
{
|
||||
assert(GetType() == "hostgroup");
|
||||
}
|
||||
|
||||
static bool Exists(const string& name);
|
||||
static HostGroup GetByName(const string& name);
|
||||
|
@ -27,7 +27,9 @@ class I2_CIB_API Service : public ConfigObjectAdapter
|
||||
public:
|
||||
Service(const ConfigObject::Ptr& configObject)
|
||||
: ConfigObjectAdapter(configObject)
|
||||
{ }
|
||||
{
|
||||
assert(GetType() == "service");
|
||||
}
|
||||
|
||||
static bool Exists(const string& name);
|
||||
static Service GetByName(const string& name);
|
||||
|
@ -9,7 +9,9 @@ class I2_CIB_API ServiceGroup : public ConfigObjectAdapter
|
||||
public:
|
||||
ServiceGroup(const ConfigObject::Ptr& configObject)
|
||||
: ConfigObjectAdapter(configObject)
|
||||
{ }
|
||||
{
|
||||
assert(GetType() == "servicegroup");
|
||||
}
|
||||
|
||||
static bool Exists(const string& name);
|
||||
static ServiceGroup GetByName(const string& name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user