MCPcopy Create free account
hub / github.com/Icinga/icinga2 / GetTemplate

Method GetTemplate

lib/base/scriptutils.cpp:429–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429Dictionary::Ptr ScriptUtils::GetTemplate(const Value& vtype, const String& name)
430{
431 Type::Ptr ptype;
432
433 if (vtype.IsObjectType<Type>())
434 ptype = vtype;
435 else
436 ptype = Type::GetByName(vtype);
437
438 ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(ptype, name);
439
440 if (!item || !item->IsAbstract())
441 return nullptr;
442
443 DebugInfo di = item->GetDebugInfo();
444
445 return GetTargetForTemplate(item);
446}
447
448Array::Ptr ScriptUtils::GetTemplates(const Type::Ptr& type)
449{

Callers

nothing calls this directly

Calls 3

GetTargetForTemplateFunction · 0.85
IsAbstractMethod · 0.45
GetDebugInfoMethod · 0.45

Tested by

no test coverage detected