]> granicus.if.org Git - icinga2/commitdiff
Make ConfigObject::{Get,Set}Field() methods public
authorGunnar Beutner <gunnar@beutner.name>
Wed, 23 Sep 2015 06:33:18 +0000 (08:33 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 23 Sep 2015 06:33:18 +0000 (08:33 +0200)
fixes #10186

lib/remote/statusqueryhandler.cpp
tools/mkclass/classcompiler.cpp

index 6a1134a87b5fcefe32283153d42bd9a3ac855026..43bc3cdebd818e8e743e05cf5971fa76d29bb7ef 100644 (file)
@@ -96,7 +96,7 @@ bool StatusQueryHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& re
                                prefix = type->GetName();
                        } else {
                                int fid = type->GetFieldId(joinAttr);
-                               joinedObj = static_cast<Object::Ptr>(obj)->NavigateField(fid);
+                               joinedObj = obj->NavigateField(fid);
 
                                if (!joinedObj)
                                        continue;
index 9382f99b1ea170333b1dd825ae1f6dc594b5419e..a4b11fdb84a7af1e3f762bded2a8201dae2241cd 100644 (file)
@@ -541,7 +541,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                       << "{ }" << std::endl << std::endl;
 
                /* SetField */
-               m_Header << "protected:" << std::endl
+               m_Header << "public:" << std::endl
                         << "\t" << "virtual void SetField(int id, const Value& value, bool suppress_events = false, const Value& cookie = Empty) override;" << std::endl;
 
                m_Impl << "void ObjectImpl<" << klass.Name << ">::SetField(int id, const Value& value, bool suppress_events, const Value& cookie)" << std::endl
@@ -585,7 +585,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                m_Impl << "}" << std::endl << std::endl;
 
                /* GetField */
-               m_Header << "protected:" << std::endl
+               m_Header << "public:" << std::endl
                         << "\t" << "virtual Value GetField(int id) const override;" << std::endl;
 
                m_Impl << "Value ObjectImpl<" << klass.Name << ">::GetField(int id) const" << std::endl
@@ -618,7 +618,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                m_Impl << "}" << std::endl << std::endl;
                
                /* ValidateField */
-               m_Header << "protected:" << std::endl
+               m_Header << "public:" << std::endl
                         << "\t" << "virtual void ValidateField(int id, const Value& value, const ValidationUtils& utils) override;" << std::endl;
 
                m_Impl << "void ObjectImpl<" << klass.Name << ">::ValidateField(int id, const Value& value, const ValidationUtils& utils)" << std::endl
@@ -662,7 +662,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                m_Impl << "}" << std::endl << std::endl;
 
                /* NotifyField */
-               m_Header << "protected:" << std::endl
+               m_Header << "public:" << std::endl
                         << "\t" << "virtual void NotifyField(int id, const Value& cookie = Empty) override;" << std::endl;
 
                m_Impl << "void ObjectImpl<" << klass.Name << ">::NotifyField(int id, const Value& cookie)" << std::endl
@@ -696,7 +696,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                m_Impl << "}" << std::endl << std::endl;
 
                /* NavigateField */
-               m_Header << "protected:" << std::endl
+               m_Header << "public:" << std::endl
                         << "\t" << "virtual Object::Ptr NavigateField(int id) const override;" << std::endl;
 
                m_Impl << "Object::Ptr ObjectImpl<" << klass.Name << ">::NavigateField(int id) const" << std::endl