mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
mkclass: inherit from Object like this: class T : virtual public Object
This allows .ti classes multiple inheritance from Object.
This commit is contained in:
parent
061338156c
commit
84cb9d8371
@ -177,7 +177,7 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
|
||||
if (IsAbstract())
|
||||
return nullptr;
|
||||
|
||||
ConfigObject::Ptr dobj = static_pointer_cast<ConfigObject>(type->Instantiate(std::vector<Value>()));
|
||||
ConfigObject::Ptr dobj = dynamic_pointer_cast<ConfigObject>(type->Instantiate(std::vector<Value>()));
|
||||
|
||||
dobj->SetDebugInfo(m_DebugInfo);
|
||||
dobj->SetZoneName(m_Zone);
|
||||
|
@ -452,8 +452,15 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
||||
|
||||
/* ObjectImpl */
|
||||
m_Header << "template<>" << std::endl
|
||||
<< "class ObjectImpl<" << klass.Name << ">"
|
||||
<< " : public " << (klass.Parent.empty() ? "Object" : klass.Parent) << std::endl
|
||||
<< "class ObjectImpl<" << klass.Name << "> : ";
|
||||
|
||||
if (klass.Parent.empty()) {
|
||||
m_Header << "virtual public Object";
|
||||
} else {
|
||||
m_Header << "public " << klass.Parent;
|
||||
}
|
||||
|
||||
m_Header << std::endl
|
||||
<< "{" << std::endl
|
||||
<< "public:" << std::endl
|
||||
<< "\t" << "DECLARE_PTR_TYPEDEFS(ObjectImpl<" << klass.Name << ">);" << std::endl << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user