]> granicus.if.org Git - icinga2/blob - lib/icinga/checkable-script.cpp
Merge pull request #6974 from Icinga/feature/copyright-generic
[icinga2] / lib / icinga / checkable-script.cpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "icinga/checkable.hpp"
4 #include "base/configobject.hpp"
5 #include "base/dictionary.hpp"
6 #include "base/function.hpp"
7 #include "base/functionwrapper.hpp"
8 #include "base/scriptframe.hpp"
9
10 using namespace icinga;
11
12 static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
13 {
14         ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
15         Checkable::Ptr self = vframe->Self;
16         REQUIRE_NOT_NULL(self);
17         self->ProcessCheckResult(cr);
18 }
19
20 Object::Ptr Checkable::GetPrototype()
21 {
22         static Dictionary::Ptr prototype = new Dictionary({
23                 { "process_check_result", new Function("Checkable#process_check_result", CheckableProcessCheckResult, { "cr" }, false) }
24         });
25
26         return prototype;
27 }
28