Verify object type in the CIB class constructors.

This commit is contained in:
Gunnar Beutner 2012-07-09 16:38:01 +02:00
parent 0032e32026
commit c7788f73c2
4 changed files with 12 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);