]> granicus.if.org Git - icinga2/commitdiff
Implement missing Type::SetField method
authorGunnar Beutner <gunnar@beutner.name>
Wed, 14 Jan 2015 12:32:40 +0000 (13:32 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 14 Jan 2015 12:34:52 +0000 (13:34 +0100)
refs #8169

lib/base/type.cpp
lib/base/type.hpp

index 93ae1b9bdda780b965cf22482f2a17ad0f9c707a..a26d8cf9bc778fc6d3c5d35fe3fc4d7d92dc4a14 100644 (file)
@@ -88,6 +88,16 @@ void Type::SetPrototype(const Object::Ptr& object)
        m_Prototype = object;
 }
 
+void Type::SetField(int id, const Value& value)
+{
+       if (id == 0) {
+               SetPrototype(value);
+               return;
+       }
+
+       Object::SetField(id, value);
+}
+
 Value Type::GetField(int id) const
 {
        if (id == 0)
index 30fd671a5138029ab0c01421bbcd61c499ef2720..f1b006daf3d4afc40d6593cdb15281e91792cc5e 100644 (file)
@@ -81,6 +81,7 @@ public:
        static void Register(const Type::Ptr& type);
        static Type::Ptr GetByName(const String& name);
 
+       virtual void SetField(int id, const Value& value);
        virtual Value GetField(int id) const;
 
 protected: