mirror of https://github.com/Icinga/icinga2.git
parent
5dd685cef9
commit
112f024810
|
@ -120,7 +120,7 @@ static Object::Ptr DeserializeObject(const Object::Ptr& object, const Dictionary
|
||||||
if (object)
|
if (object)
|
||||||
instance = object;
|
instance = object;
|
||||||
else
|
else
|
||||||
instance = type->Instantiate();
|
instance = type->Instantiate(std::vector<Value>());
|
||||||
|
|
||||||
ObjectLock olock(input);
|
ObjectLock olock(input);
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv, input) {
|
BOOST_FOREACH(const Dictionary::Pair& kv, input) {
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
|
|
||||||
String GetPluralName(void) const;
|
String GetPluralName(void) const;
|
||||||
|
|
||||||
Object::Ptr Instantiate(const std::vector<Value>& args = std::vector<Value>()) const;
|
Object::Ptr Instantiate(const std::vector<Value>& args) const;
|
||||||
|
|
||||||
bool IsAssignableFrom(const Type::Ptr& other) const;
|
bool IsAssignableFrom(const Type::Ptr& other) const;
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ bool RepositoryUtility::AddObject(const std::vector<String>& object_paths, const
|
||||||
|
|
||||||
if (check_config) {
|
if (check_config) {
|
||||||
try {
|
try {
|
||||||
ConfigObject::Ptr object = static_pointer_cast<ConfigObject>(utype->Instantiate());
|
ConfigObject::Ptr object = static_pointer_cast<ConfigObject>(utype->Instantiate(std::vector<Value>()));
|
||||||
/* temporarly set the object type for validation */
|
/* temporarly set the object type for validation */
|
||||||
attrs->Set("type", utype->GetName());
|
attrs->Set("type", utype->GetName());
|
||||||
Deserialize(object, attrs, false, FAConfig);
|
Deserialize(object, attrs, false, FAConfig);
|
||||||
|
|
|
@ -173,7 +173,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
|
||||||
if (IsAbstract())
|
if (IsAbstract())
|
||||||
return ConfigObject::Ptr();
|
return ConfigObject::Ptr();
|
||||||
|
|
||||||
ConfigObject::Ptr dobj = static_pointer_cast<ConfigObject>(type->Instantiate());
|
ConfigObject::Ptr dobj = static_pointer_cast<ConfigObject>(type->Instantiate(std::vector<Value>()));
|
||||||
|
|
||||||
dobj->SetDebugInfo(m_DebugInfo);
|
dobj->SetDebugInfo(m_DebugInfo);
|
||||||
dobj->SetZoneName(m_Zone);
|
dobj->SetZoneName(m_Zone);
|
||||||
|
|
|
@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(instantiate)
|
||||||
{
|
{
|
||||||
Type::Ptr t = Type::GetByName("PerfdataValue");
|
Type::Ptr t = Type::GetByName("PerfdataValue");
|
||||||
|
|
||||||
Object::Ptr p = t->Instantiate();
|
Object::Ptr p = t->Instantiate(std::vector<Value>());
|
||||||
|
|
||||||
BOOST_CHECK(p);
|
BOOST_CHECK(p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue