1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "base/reference.hpp"
4 #include "base/function.hpp"
5 #include "base/functionwrapper.hpp"
6 #include "base/scriptframe.hpp"
7 #include "base/exception.hpp"
9 using namespace icinga;
11 static void ReferenceSet(const Value& value)
13 ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
14 Reference::Ptr self = static_cast<Reference::Ptr>(vframe->Self);
15 REQUIRE_NOT_NULL(self);
19 static Value ReferenceGet()
21 ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
22 Reference::Ptr self = static_cast<Reference::Ptr>(vframe->Self);
23 REQUIRE_NOT_NULL(self);
27 Object::Ptr Reference::GetPrototype()
29 static Dictionary::Ptr prototype = new Dictionary({
30 { "set", new Function("Reference#set", ReferenceSet, { "value" }) },
31 { "get", new Function("Reference#get", ReferenceGet, {}, true) },