]> granicus.if.org Git - icinga2/commitdiff
Rename ScriptFunction to Function
authorGunnar Beutner <gunnar@beutner.name>
Wed, 21 Jan 2015 07:47:45 +0000 (08:47 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 21 Jan 2015 07:48:38 +0000 (08:48 +0100)
fixes #8258

42 files changed:
lib/base/CMakeLists.txt
lib/base/array-script.cpp
lib/base/boolean-script.cpp
lib/base/dictionary-script.cpp
lib/base/dynamicobject.cpp
lib/base/function-script.cpp [moved from lib/base/scriptfunction-script.cpp with 78% similarity]
lib/base/function.cpp [moved from lib/base/scriptfunction.cpp with 87% similarity]
lib/base/function.hpp [moved from lib/base/scriptfunction.hpp with 89% similarity]
lib/base/functionwrapper.cpp [moved from lib/base/scriptfunctionwrapper.cpp with 81% similarity]
lib/base/functionwrapper.hpp [moved from lib/base/scriptfunctionwrapper.hpp with 72% similarity]
lib/base/math-script.cpp
lib/base/number-script.cpp
lib/base/object-script.cpp
lib/base/scriptutils.cpp
lib/base/string-script.cpp
lib/compat/compatlogger.cpp
lib/config/configitem.cpp
lib/config/configtype.cpp
lib/config/expression.cpp
lib/config/expression.hpp
lib/config/vmops.hpp
lib/db_ido/dbconnection.cpp
lib/icinga/checkable.cpp
lib/icinga/command.cpp
lib/icinga/command.ti
lib/icinga/dependency.cpp
lib/icinga/legacytimeperiod.cpp
lib/icinga/notification.cpp
lib/icinga/timeperiod.ti
lib/icinga/user.cpp
lib/livestatus/livestatuslistener.cpp
lib/methods/clrchecktask.cpp
lib/methods/clusterchecktask.cpp
lib/methods/clusterzonechecktask.cpp
lib/methods/icingachecktask.cpp
lib/methods/nullchecktask.cpp
lib/methods/nulleventtask.cpp
lib/methods/pluginchecktask.cpp
lib/methods/plugineventtask.cpp
lib/methods/pluginnotificationtask.cpp
lib/methods/randomchecktask.cpp
lib/methods/timeperiodtask.cpp

index 0fe01867597256ec53825ca3ac1732e6ac795320..3630f2be41fe872bbca4350d8d0df0fcbd139972 100644 (file)
@@ -27,7 +27,7 @@ set(base_SOURCES
   convert.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp dynamicobject.cpp dynamicobject.thpp dynamictype.cpp
   exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp logger.cpp logger.thpp math-script.cpp
   netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp object-script.cpp primitivetype.cpp process.cpp
-  ringbuffer.cpp scriptframe.cpp scriptfunction.cpp scriptfunction-script.cpp scriptfunctionwrapper.cpp scriptglobal.cpp
+  ringbuffer.cpp scriptframe.cpp function.cpp function-script.cpp functionwrapper.cpp scriptglobal.cpp
   scriptutils.cpp serializer.cpp socket.cpp stacktrace.cpp
   statsfunction.cpp stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp
   sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp thinmutex.cpp threadpool.cpp timer.cpp
index 46f020a0389c4e5de38bc041b051264f0f70f605..38dab7f280e6d6f03127eded074acd0c38a95de4 100644 (file)
@@ -18,8 +18,8 @@
  ******************************************************************************/
 
 #include "base/array.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 #include "base/objectlock.hpp"
 
@@ -67,7 +67,7 @@ static void ArrayClear(void)
        self->Clear();
 }
 
-static bool ArraySortCmp(const ScriptFunction::Ptr& cmp, const Value& a, const Value& b)
+static bool ArraySortCmp(const Function::Ptr& cmp, const Value& a, const Value& b)
 {
        std::vector<Value> args;
        args.push_back(a);
@@ -106,14 +106,14 @@ Object::Ptr Array::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("len", new ScriptFunction(WrapScriptFunction(ArrayLen)));
-               prototype->Set("set", new ScriptFunction(WrapScriptFunction(ArraySet)));
-               prototype->Set("add", new ScriptFunction(WrapScriptFunction(ArrayAdd)));
-               prototype->Set("remove", new ScriptFunction(WrapScriptFunction(ArrayRemove)));
-               prototype->Set("contains", new ScriptFunction(WrapScriptFunction(ArrayContains)));
-               prototype->Set("clear", new ScriptFunction(WrapScriptFunction(ArrayClear)));
-               prototype->Set("sort", new ScriptFunction(WrapScriptFunction(ArraySort)));
-               prototype->Set("clone", new ScriptFunction(WrapScriptFunction(ArrayClone)));
+               prototype->Set("len", new Function(WrapFunction(ArrayLen)));
+               prototype->Set("set", new Function(WrapFunction(ArraySet)));
+               prototype->Set("add", new Function(WrapFunction(ArrayAdd)));
+               prototype->Set("remove", new Function(WrapFunction(ArrayRemove)));
+               prototype->Set("contains", new Function(WrapFunction(ArrayContains)));
+               prototype->Set("clear", new Function(WrapFunction(ArrayClear)));
+               prototype->Set("sort", new Function(WrapFunction(ArraySort)));
+               prototype->Set("clone", new Function(WrapFunction(ArrayClone)));
        }
 
        return prototype;
index 29f6374634430d837a12a04d21781d044f4edcf7..262c31ba09f215da8ad9e11bdf661796d7da1455 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "base/boolean.hpp"
 #include "base/convert.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 
 using namespace icinga;
@@ -38,7 +38,7 @@ Object::Ptr Boolean::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("to_string", new ScriptFunction(WrapScriptFunction(BooleanToString)));
+               prototype->Set("to_string", new Function(WrapFunction(BooleanToString)));
        }
 
        return prototype;
index c46cdc9907169a3b75228a290e4e271a54182a10..6f2215c4765420aefcc947278b81bc2b95f8be12 100644 (file)
@@ -18,8 +18,8 @@
  ******************************************************************************/
 
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 
 using namespace icinga;
@@ -65,11 +65,11 @@ Object::Ptr Dictionary::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("len", new ScriptFunction(WrapScriptFunction(DictionaryLen)));
-               prototype->Set("set", new ScriptFunction(WrapScriptFunction(DictionarySet)));
-               prototype->Set("remove", new ScriptFunction(WrapScriptFunction(DictionaryRemove)));
-               prototype->Set("contains", new ScriptFunction(WrapScriptFunction(DictionaryContains)));
-               prototype->Set("clone", new ScriptFunction(WrapScriptFunction(DictionaryClone)));
+               prototype->Set("len", new Function(WrapFunction(DictionaryLen)));
+               prototype->Set("set", new Function(WrapFunction(DictionarySet)));
+               prototype->Set("remove", new Function(WrapFunction(DictionaryRemove)));
+               prototype->Set("contains", new Function(WrapFunction(DictionaryContains)));
+               prototype->Set("clone", new Function(WrapFunction(DictionaryClone)));
        }
 
        return prototype;
index 55438ee9189e348b8b42edf4f5e1996570e24ee2..bfbe2ab6a3824bfe71f08bd2de937bf59b3f4239 100644 (file)
@@ -27,7 +27,7 @@
 #include "base/objectlock.hpp"
 #include "base/logger.hpp"
 #include "base/exception.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/initialize.hpp"
 #include "base/workqueue.hpp"
 #include "base/context.hpp"
similarity index 78%
rename from lib/base/scriptfunction-script.cpp
rename to lib/base/function-script.cpp
index 02e501ed98a04cf6221cb0f51c37145786e0d267..4aec0759b66562f3a4de2866756f4760f2cd85d0 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 #include "base/objectlock.hpp"
 #include "base/exception.hpp"
 
 using namespace icinga;
 
-static Value ScriptFunctionCall(const std::vector<Value>& args)
+static Value FunctionCall(const std::vector<Value>& args)
 {
        if (args.size() < 1)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for call()"));
 
        ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
-       ScriptFunction::Ptr self = static_cast<ScriptFunction::Ptr>(vframe->Self);
+       Function::Ptr self = static_cast<Function::Ptr>(vframe->Self);
 
        ScriptFrame uframe(args[0]);
        std::vector<Value> uargs(args.begin() + 1, args.end());
        return self->Invoke(uargs);
 }
 
-static Value ScriptFunctionCallV(const Value& thisArg, const Array::Ptr& args)
+static Value FunctionCallV(const Value& thisArg, const Array::Ptr& args)
 {
        ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
-       ScriptFunction::Ptr self = static_cast<ScriptFunction::Ptr>(vframe->Self);
+       Function::Ptr self = static_cast<Function::Ptr>(vframe->Self);
 
        ScriptFrame uframe(thisArg);
        std::vector<Value> uargs;
@@ -55,14 +55,14 @@ static Value ScriptFunctionCallV(const Value& thisArg, const Array::Ptr& args)
 }
 
 
-Object::Ptr ScriptFunction::GetPrototype(void)
+Object::Ptr Function::GetPrototype(void)
 {
        static Dictionary::Ptr prototype;
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("call", new ScriptFunction(WrapScriptFunction(ScriptFunctionCall)));
-               prototype->Set("callv", new ScriptFunction(WrapScriptFunction(ScriptFunctionCallV)));
+               prototype->Set("call", new Function(WrapFunction(FunctionCall)));
+               prototype->Set("callv", new Function(WrapFunction(FunctionCallV)));
        }
 
        return prototype;
similarity index 87%
rename from lib/base/scriptfunction.cpp
rename to lib/base/function.cpp
index 5b9c6dc03aea6564479dfe9cfce25d7be14a8212..69d895a6fc5edc9ff5bb4f8eb1926ebccf164119 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/primitivetype.hpp"
 #include "base/dictionary.hpp"
 
 using namespace icinga;
 
-REGISTER_PRIMITIVE_TYPE(ScriptFunction, ScriptFunction::GetPrototype());
+REGISTER_PRIMITIVE_TYPE(Function, Function::GetPrototype());
 
-ScriptFunction::ScriptFunction(const Callback& function)
+Function::Function(const Callback& function)
        : m_Callback(function)
 { }
 
-Value ScriptFunction::Invoke(const std::vector<Value>& arguments)
+Value Function::Invoke(const std::vector<Value>& arguments)
 {
        return m_Callback(arguments);
 }
similarity index 89%
rename from lib/base/scriptfunction.hpp
rename to lib/base/function.hpp
index a438462208bbd2fcd0a793068b68d68c325a9dfc..889c745a1a650a681d05a97e56f5d26cccbafcbc 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "base/i2-base.hpp"
 #include "base/value.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptglobal.hpp"
 #include <vector>
 #include <boost/function.hpp>
@@ -35,14 +35,14 @@ namespace icinga
  *
  * @ingroup base
  */
-class I2_BASE_API ScriptFunction : public Object
+class I2_BASE_API Function : public Object
 {
 public:
-       DECLARE_OBJECT(ScriptFunction);
+       DECLARE_OBJECT(Function);
 
        typedef boost::function<Value (const std::vector<Value>& arguments)> Callback;
 
-       ScriptFunction(const Callback& function);
+       Function(const Callback& function);
 
        Value Invoke(const std::vector<Value>& arguments);
 
@@ -55,7 +55,7 @@ private:
 #define REGISTER_SCRIPTFUNCTION(name, callback) \
        namespace { namespace UNIQUE_NAME(sf) { namespace sf ## name { \
                void RegisterFunction(void) { \
-                       ScriptFunction::Ptr sf = new icinga::ScriptFunction(WrapScriptFunction(callback)); \
+                       Function::Ptr sf = new icinga::Function(WrapFunction(callback)); \
                        ScriptGlobal::Set(#name, sf); \
                } \
                INITIALIZE_ONCE(RegisterFunction); \
similarity index 81%
rename from lib/base/scriptfunctionwrapper.cpp
rename to lib/base/functionwrapper.cpp
index 80e6590c6f306a61eb9ced338f926b3401b67d65..c4d64c1d2b9b070ea44871be67a35ff4320d9bbf 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/functionwrapper.hpp"
 
 using namespace icinga;
 
-Value icinga::ScriptFunctionWrapperVV(void (*function)(void), const std::vector<Value>&)
+Value icinga::FunctionWrapperVV(void (*function)(void), const std::vector<Value>&)
 {
        function();
 
        return Empty;
 }
 
-Value icinga::ScriptFunctionWrapperVA(void (*function)(const std::vector<Value>&), const std::vector<Value>& arguments)
+Value icinga::FunctionWrapperVA(void (*function)(const std::vector<Value>&), const std::vector<Value>& arguments)
 {
        function(arguments);
 
        return Empty;
 }
 
-boost::function<Value (const std::vector<Value>& arguments)> icinga::WrapScriptFunction(void (*function)(void))
+boost::function<Value (const std::vector<Value>& arguments)> icinga::WrapFunction(void (*function)(void))
 {
-       return boost::bind(&ScriptFunctionWrapperVV, function, _1);
+       return boost::bind(&FunctionWrapperVV, function, _1);
 }
similarity index 72%
rename from lib/base/scriptfunctionwrapper.hpp
rename to lib/base/functionwrapper.hpp
index e0b08be4182dab903ec91232a5fcaa4c07c836eb..ff28dcec695eda14f16184b83edbc8b749f0b102 100644 (file)
 namespace icinga
 {
 
-Value ScriptFunctionWrapperVV(void (*function)(void), const std::vector<Value>& arguments);
-Value ScriptFunctionWrapperVA(void (*function)(const std::vector<Value>&), const std::vector<Value>& arguments);
+Value FunctionWrapperVV(void (*function)(void), const std::vector<Value>& arguments);
+Value FunctionWrapperVA(void (*function)(const std::vector<Value>&), const std::vector<Value>& arguments);
 
-boost::function<Value (const std::vector<Value>& arguments)> I2_BASE_API WrapScriptFunction(void (*function)(void));
+boost::function<Value (const std::vector<Value>& arguments)> I2_BASE_API WrapFunction(void (*function)(void));
 
 template<typename TR>
-Value ScriptFunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
+Value FunctionWrapperR(TR (*function)(void), const std::vector<Value>&)
 {
        return function();
 }
 
 template<typename TR>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(void))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(void))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR>, function, _1);
 }
 
 template<typename T0>
-Value ScriptFunctionWrapperV(void (*function)(T0), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 1)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -58,13 +58,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0), const std::vector<Value>& arg
 }
 
 template<typename T0>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0>, function, _1);
 }
 
 template<typename TR, typename T0>
-Value ScriptFunctionWrapperR(TR (*function)(T0), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 1)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -73,13 +73,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0), const std::vector<Value>& argum
 }
 
 template<typename TR, typename T0>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0>, function, _1);
 }
 
 template<typename T0, typename T1>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 2)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -91,13 +91,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1), const std::vector<Value>&
 }
 
 template<typename T0, typename T1>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 2)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -107,13 +107,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1), const std::vector<Value>& a
 }
 
 template<typename TR, typename T0, typename T1>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 3)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -126,13 +126,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2), const std::vector<Val
 }
 
 template<typename T0, typename T1, typename T2>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 3)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -143,13 +143,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2), const std::vector<Value
 }
 
 template<typename TR, typename T0, typename T1, typename T2>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2, typename T3>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2, T3), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 4)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -163,13 +163,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3), const std::vector
 }
 
 template<typename T0, typename T1, typename T2, typename T3>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2, T3))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2, T3>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2, T3>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 4)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -181,13 +181,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3), const std::vector<V
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2, T3))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2, T3>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 5)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -202,13 +202,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4), const std::ve
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2, T3, T4))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2, T3, T4>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 5)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -221,13 +221,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4), const std::vect
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2, T3, T4))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2, T3, T4>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 6)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -243,13 +243,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5), const std
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2, T3, T4, T5))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2, T3, T4, T5>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 6)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -263,13 +263,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5), const std::
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2, T3, T4, T5))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2, T3, T4, T5>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 7)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -286,13 +286,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6), const
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2, T3, T4, T5, T6>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 7)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -307,13 +307,13 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6), const s
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6>, function, _1);
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std::vector<Value>& arguments)
+Value FunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 8)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -331,13 +331,13 @@ Value ScriptFunctionWrapperV(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7), c
 }
 
 template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
 {
-       return boost::bind(&ScriptFunctionWrapperV<T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
+       return boost::bind(&FunctionWrapperV<T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std::vector<Value>& arguments)
+Value FunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7), const std::vector<Value>& arguments)
 {
        if (arguments.size() < 8)
                BOOST_THROW_EXCEPTION(std::invalid_argument("Too few arguments for function."));
@@ -353,20 +353,20 @@ Value ScriptFunctionWrapperR(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7), con
 }
 
 template<typename TR, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
+boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(T0, T1, T2, T3, T4, T5, T6, T7))
 {
-       return boost::bind(&ScriptFunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
+       return boost::bind(&FunctionWrapperR<TR, T0, T1, T2, T3, T4, T5, T6, T7>, function, _1);
 }
 
 template<typename TR>
-boost::function<TR (const std::vector<Value>& arguments)> WrapScriptFunction(TR (*function)(const std::vector<Value>&))
+boost::function<TR (const std::vector<Value>& arguments)> WrapFunction(TR (*function)(const std::vector<Value>&))
 {
        return boost::bind<TR>(function, _1);
 }
 
-inline boost::function<Value (const std::vector<Value>& arguments)> WrapScriptFunction(void (*function)(const std::vector<Value>&))
+inline boost::function<Value (const std::vector<Value>& arguments)> WrapFunction(void (*function)(const std::vector<Value>&))
 {
-       return boost::bind(&ScriptFunctionWrapperVA, function, _1);
+       return boost::bind(&FunctionWrapperVA, function, _1);
 }
 
 }
index 7f2023f7b2b5f9833f69925147082f6e59b00f4f..7e7a0badaa687f36b6f19ec9969f14ce9d79a637 100644 (file)
@@ -18,8 +18,8 @@
  ******************************************************************************/
 
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 #include "base/initialize.hpp"
 #include <boost/math/special_functions/round.hpp>
@@ -174,27 +174,27 @@ static void InitializeMathObj(void)
        mathObj->Set("SQRT2", 1.41421356237309504880);
 
        /* Methods */
-       mathObj->Set("abs", new ScriptFunction(WrapScriptFunction(MathAbs)));
-       mathObj->Set("acos", new ScriptFunction(WrapScriptFunction(MathAcos)));
-       mathObj->Set("asin", new ScriptFunction(WrapScriptFunction(MathAsin)));
-       mathObj->Set("atan", new ScriptFunction(WrapScriptFunction(MathAtan)));
-       mathObj->Set("atan2", new ScriptFunction(WrapScriptFunction(MathAtan2)));
-       mathObj->Set("ceil", new ScriptFunction(WrapScriptFunction(MathCeil)));
-       mathObj->Set("cos", new ScriptFunction(WrapScriptFunction(MathCos)));
-       mathObj->Set("exp", new ScriptFunction(WrapScriptFunction(MathExp)));
-       mathObj->Set("floor", new ScriptFunction(WrapScriptFunction(MathFloor)));
-       mathObj->Set("log", new ScriptFunction(WrapScriptFunction(MathLog)));
-       mathObj->Set("max", new ScriptFunction(WrapScriptFunction(MathMax)));
-       mathObj->Set("min", new ScriptFunction(WrapScriptFunction(MathMin)));
-       mathObj->Set("pow", new ScriptFunction(WrapScriptFunction(MathPow)));
-       mathObj->Set("random", new ScriptFunction(WrapScriptFunction(MathRandom)));
-       mathObj->Set("round", new ScriptFunction(WrapScriptFunction(MathRound)));
-       mathObj->Set("sin", new ScriptFunction(WrapScriptFunction(MathSin)));
-       mathObj->Set("sqrt", new ScriptFunction(WrapScriptFunction(MathSqrt)));
-       mathObj->Set("tan", new ScriptFunction(WrapScriptFunction(MathTan)));
-       mathObj->Set("isnan", new ScriptFunction(WrapScriptFunction(MathIsnan)));
-       mathObj->Set("isinf", new ScriptFunction(WrapScriptFunction(MathIsinf)));
-       mathObj->Set("sign", new ScriptFunction(WrapScriptFunction(MathSign)));
+       mathObj->Set("abs", new Function(WrapFunction(MathAbs)));
+       mathObj->Set("acos", new Function(WrapFunction(MathAcos)));
+       mathObj->Set("asin", new Function(WrapFunction(MathAsin)));
+       mathObj->Set("atan", new Function(WrapFunction(MathAtan)));
+       mathObj->Set("atan2", new Function(WrapFunction(MathAtan2)));
+       mathObj->Set("ceil", new Function(WrapFunction(MathCeil)));
+       mathObj->Set("cos", new Function(WrapFunction(MathCos)));
+       mathObj->Set("exp", new Function(WrapFunction(MathExp)));
+       mathObj->Set("floor", new Function(WrapFunction(MathFloor)));
+       mathObj->Set("log", new Function(WrapFunction(MathLog)));
+       mathObj->Set("max", new Function(WrapFunction(MathMax)));
+       mathObj->Set("min", new Function(WrapFunction(MathMin)));
+       mathObj->Set("pow", new Function(WrapFunction(MathPow)));
+       mathObj->Set("random", new Function(WrapFunction(MathRandom)));
+       mathObj->Set("round", new Function(WrapFunction(MathRound)));
+       mathObj->Set("sin", new Function(WrapFunction(MathSin)));
+       mathObj->Set("sqrt", new Function(WrapFunction(MathSqrt)));
+       mathObj->Set("tan", new Function(WrapFunction(MathTan)));
+       mathObj->Set("isnan", new Function(WrapFunction(MathIsnan)));
+       mathObj->Set("isinf", new Function(WrapFunction(MathIsinf)));
+       mathObj->Set("sign", new Function(WrapFunction(MathSign)));
 
        ScriptGlobal::Set("Math", mathObj);
 }
index 76dd582dc5ba2362628b8b93e3e5ee30fae66b84..19768db215d74425bd422103479c9d135208abc9 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "base/number.hpp"
 #include "base/convert.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 
 using namespace icinga;
@@ -38,7 +38,7 @@ Object::Ptr Number::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("to_string", new ScriptFunction(WrapScriptFunction(NumberToString)));
+               prototype->Set("to_string", new Function(WrapFunction(NumberToString)));
        }
 
        return prototype;
index c1d202d03548db86dd86a789482097d2c60e0b2e..196db9c473454006224f1a27ed760c57cf3bb4f0 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "base/object.hpp"
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 
 using namespace icinga;
@@ -38,7 +38,7 @@ Object::Ptr Object::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("to_string", new ScriptFunction(WrapScriptFunction(ObjectToString)));
+               prototype->Set("to_string", new Function(WrapFunction(ObjectToString)));
        }
 
        return prototype;
index ceabf1ec83a7c965c6cb0156ec7856f9e5f016e7..1aeea549f713e0205d40b90f8a26969410bc2c76 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "base/scriptutils.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
 #include "base/json.hpp"
index 725270d9ab978cdb07172fe0d90e2c78826a08fa..43fb9f27119e64386fb65aab2073471d363c2585 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "base/object.hpp"
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
-#include "base/scriptfunctionwrapper.hpp"
+#include "base/function.hpp"
+#include "base/functionwrapper.hpp"
 #include "base/scriptframe.hpp"
 #include "base/exception.hpp"
 #include <boost/algorithm/string.hpp>
@@ -126,14 +126,14 @@ Object::Ptr String::GetPrototype(void)
 
        if (!prototype) {
                prototype = new Dictionary();
-               prototype->Set("len", new ScriptFunction(WrapScriptFunction(StringLen)));
-               prototype->Set("to_string", new ScriptFunction(WrapScriptFunction(StringToString)));
-               prototype->Set("substr", new ScriptFunction(WrapScriptFunction(StringSubstr)));
-               prototype->Set("upper", new ScriptFunction(WrapScriptFunction(StringUpper)));
-               prototype->Set("lower", new ScriptFunction(WrapScriptFunction(StringLower)));
-               prototype->Set("split", new ScriptFunction(WrapScriptFunction(StringSplit)));
-               prototype->Set("find", new ScriptFunction(WrapScriptFunction(StringFind)));
-               prototype->Set("replace", new ScriptFunction(WrapScriptFunction(StringReplace)));
+               prototype->Set("len", new Function(WrapFunction(StringLen)));
+               prototype->Set("to_string", new Function(WrapFunction(StringToString)));
+               prototype->Set("substr", new Function(WrapFunction(StringSubstr)));
+               prototype->Set("upper", new Function(WrapFunction(StringUpper)));
+               prototype->Set("lower", new Function(WrapFunction(StringLower)));
+               prototype->Set("split", new Function(WrapFunction(StringSplit)));
+               prototype->Set("find", new Function(WrapFunction(StringFind)));
+               prototype->Set("replace", new Function(WrapFunction(StringReplace)));
        }
 
        return prototype;
index 7690dc1dd336f69174768d84ec57e93ddc10c662..cdc2ffd8324ccdb227397b2fe88ac6e30bef14e2 100644 (file)
@@ -32,7 +32,7 @@
 #include "base/convert.hpp"
 #include "base/application.hpp"
 #include "base/utility.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/statsfunction.hpp"
 #include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
index c3b87f85750fe3a286767d068d4bc5270bbce9a8..adfadab47e637f4b668f4eb10fbbc316eff9a1e5 100644 (file)
@@ -35,7 +35,7 @@
 #include "base/serializer.hpp"
 #include "base/json.hpp"
 #include "base/exception.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include <sstream>
 #include <fstream>
 #include <boost/foreach.hpp>
index 0a226af30c634362c1a09da50b66f3be2b7edc24..bfe3f896f36a19aee0eca80408b8d029774b6597 100644 (file)
@@ -22,7 +22,7 @@
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include "base/singleton.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
@@ -172,7 +172,7 @@ void ConfigType::ValidateObject(const Object::Ptr& object,
                String validator = ruleList->GetValidator();
 
                if (!validator.IsEmpty()) {
-                       ScriptFunction::Ptr func = ScriptGlobal::Get(validator, &Empty);
+                       Function::Ptr func = ScriptGlobal::Get(validator, &Empty);
 
                        if (!func)
                                BOOST_THROW_EXCEPTION(std::invalid_argument("Validator function '" + validator + "' does not exist."));
@@ -229,7 +229,7 @@ void ConfigType::ValidateArray(const Array::Ptr& array,
                String validator = ruleList->GetValidator();
 
                if (!validator.IsEmpty()) {
-                       ScriptFunction::Ptr func = ScriptGlobal::Get(validator, &Empty);
+                       Function::Ptr func = ScriptGlobal::Get(validator, &Empty);
 
                        if (!func)
                                BOOST_THROW_EXCEPTION(std::invalid_argument("Validator function '" + validator + "' does not exist."));
index 5bf17806c26a619faf3aa78c503bb333fd7f5f2d..7aa79105f382492edf57594cb22e192bfe78d778 100644 (file)
@@ -267,10 +267,10 @@ Value FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) c
        else
                vfunc = m_FName->Evaluate(frame);
 
-       if (!vfunc.IsObjectType<ScriptFunction>())
+       if (!vfunc.IsObjectType<Function>())
                BOOST_THROW_EXCEPTION(ScriptError("Argument is not a callable object.", m_DebugInfo));
 
-       ScriptFunction::Ptr func = vfunc;
+       Function::Ptr func = vfunc;
 
        std::vector<Value> arguments;
        BOOST_FOREACH(Expression *arg, m_Args) {
index 6948d1ccabda75b5415ffeb6c77e8d763aa6a9ba..c2a78cc347c34d04089f7120a5a072e214382d57 100644 (file)
@@ -24,7 +24,7 @@
 #include "base/debuginfo.hpp"
 #include "base/array.hpp"
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/exception.hpp"
 #include "base/scriptframe.hpp"
 #include "base/convert.hpp"
index cb5f3e508b681697492dd92cf802d1359b4e0308..d1cde03d3873b584954714ad6a224ab58aa78181 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/debuginfo.hpp"
 #include "base/array.hpp"
 #include "base/dictionary.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/scriptglobal.hpp"
 #include "base/exception.hpp"
 #include "base/convert.hpp"
@@ -54,7 +54,7 @@ public:
                        return ScriptGlobal::Get(name);
        }
 
-       static inline Value FunctionCall(ScriptFrame& frame, const Value& self, const ScriptFunction::Ptr& func, const std::vector<Value>& arguments)
+       static inline Value FunctionCall(ScriptFrame& frame, const Value& self, const Function::Ptr& func, const std::vector<Value>& arguments)
        {
                boost::shared_ptr<ScriptFrame> vframe;
 
@@ -69,7 +69,7 @@ public:
        static inline Value NewFunction(ScriptFrame& frame, const std::vector<String>& args,
            std::map<String, Expression *> *closedVars, const boost::shared_ptr<Expression>& expression)
        {
-               return new ScriptFunction(boost::bind(&FunctionWrapper, _1, args,
+               return new Function(boost::bind(&FunctionWrapper, _1, args,
                    EvaluateClosedVars(frame, closedVars), expression));
        }
 
index 54fa30b1150164bfa283605aa541a80ba5a34349..da50aa0b14ff097471cd8cb15ab4be32eece80f6 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/utility.hpp"
 #include "base/initialize.hpp"
 #include "base/logger.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/exception.hpp"
 #include <boost/foreach.hpp>
 
index ad8a9211784e5c20d2415e56429d6e28f49e1451..846161b71bd35d178027dde132e87ef3fdde6580 100644 (file)
@@ -20,7 +20,7 @@
 #include "icinga/checkable.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/exception.hpp"
 #include <boost/foreach.hpp>
 #include <boost/bind/apply.hpp>
index b6ccf9fd415049d77acafcd7b16854bbe587166b..ff58a4baf16f49f6997d320a97de82883f38704f 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/command.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/exception.hpp"
 
 using namespace icinga;
index 0b1fc6480ac2a289cb0bce4300325d180708c0ff..0b4c4881d2c4272e2f23adc603b39cead6469562 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/customvarobject.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 
 namespace icinga
 {
@@ -31,7 +31,7 @@ abstract class Command : CustomVarObject
                default {{{ return 60; }}}
        };
        [config] Dictionary::Ptr env;
-       [config] ScriptFunction::Ptr execute;
+       [config] Function::Ptr execute;
 };
 
 }
index db7d945c08a3490fc7886390067fd0788bc9e8b3..d04e348a6380e6d90809a0d1ffad93fe6a1dc510 100644 (file)
@@ -20,7 +20,7 @@
 #include "icinga/dependency.hpp"
 #include "icinga/service.hpp"
 #include "base/logger.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/exception.hpp"
 #include <boost/foreach.hpp>
 
index e2f3aa119668fbd7d63a5fb650cf6b78b992a97c..456e051873943e08136d1e9385b34e5f490da91e 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/legacytimeperiod.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/convert.hpp"
 #include "base/exception.hpp"
 #include "base/objectlock.hpp"
index 4bc207cc9e727247df2df66abe24f9988c6e64fe..3d457cf43b6085e08bd23f63bb0575055362abb2 100644 (file)
@@ -27,7 +27,7 @@
 #include "base/exception.hpp"
 #include "base/initialize.hpp"
 #include "base/scriptglobal.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
index 6c12e77205625bf370f365fa993e36dfebdd47e9..cc062645ceca7fe1b991e4d34499efde3f99b2fe 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "icinga/customvarobject.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 
 namespace icinga
 {
@@ -34,7 +34,7 @@ class TimePeriod : CustomVarObject
                }}}
        };
        [config] Dictionary::Ptr ranges;
-       [config] ScriptFunction::Ptr update;
+       [config] Function::Ptr update;
        [state] Value valid_begin;
        [state] Value valid_end;
        [state] Array::Ptr segments;
index 434e520ad8e9677e2e5202b86126ffd00e5f8318..c9f42a1b952a322473c2b8a33851fc85467f140f 100644 (file)
@@ -21,7 +21,7 @@
 #include "icinga/usergroup.hpp"
 #include "icinga/notification.hpp"
 #include "icinga/usergroup.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/objectlock.hpp"
 #include "base/exception.hpp"
 #include <boost/foreach.hpp>
index 7d8252cd38031e81b1a43d8f44eccbb5b7993d46..a0c6683b0a965babb056db27735c2db68eb27bf6 100644 (file)
@@ -28,7 +28,7 @@
 #include "base/unixsocket.hpp"
 #include "base/networkstream.hpp"
 #include "base/application.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/statsfunction.hpp"
 #include "base/convert.hpp"
 
index e77fd69ff4a3bd43ba2566c8827d114ad1efb03c..bad67ad6b1fc9c0b0c53073ed60289004750299b 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "base/dynamictype.hpp"
 #include "base/logger.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/utility.hpp"
 #include "base/process.hpp"
 #include <boost/algorithm/string/classification.hpp>
index 36f24bea44e47de2bb8e453ced881d89e6ccaeec..43ad37b774524a7bb0210acd7f09d212ebd4b522 100644 (file)
@@ -27,7 +27,7 @@
 #include "base/objectlock.hpp"
 #include "base/convert.hpp"
 #include "base/utility.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/dynamictype.hpp"
 #include <boost/algorithm/string/join.hpp>
 #include <boost/foreach.hpp>
index a8fc94833e8ccfb656a6410d96a5eba6fab1590d..d5945c85d8ed175b42c92d91d64c57a2f14a9c4e 100644 (file)
@@ -23,7 +23,7 @@
 #include "remote/apilistener.hpp"
 #include "remote/endpoint.hpp"
 #include "remote/zone.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include <boost/foreach.hpp>
 
 using namespace icinga;
index 808e1581cd556ffcab67766954db54afaf969b3b..4ef7917435cb29fe328c98324e072dbeed66156b 100644 (file)
@@ -25,7 +25,7 @@
 #include "base/application.hpp"
 #include "base/objectlock.hpp"
 #include "base/utility.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/dynamictype.hpp"
 
 using namespace icinga;
index 09f369ddff72a4aa8d0161c62f21bc53d13a7fee..e779fe7d4b033a02d9e37a04dccd231d548659f0 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/perfdatavalue.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/logger.hpp"
 
 using namespace icinga;
index 4332a67d10e692b97c0e8b1ec1913b70cc86d0ec..35a64ca78ae9d496e3f1c9675f82f37e845d99b1 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "methods/nulleventtask.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/logger.hpp"
 
 using namespace icinga;
index b45dcf72cc453bb6a098ceebff916425c84bb25c..c3896e89e6482081588776d01aa1441249fd41c7 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "base/dynamictype.hpp"
 #include "base/logger.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/utility.hpp"
 #include "base/process.hpp"
 #include "base/convert.hpp"
index e976b00180e88ad9874e31353f727f662598b862..b637c345f419e80f3bdc701f56ce707305c4fad3 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/icingaapplication.hpp"
 #include "base/dynamictype.hpp"
 #include "base/logger.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/utility.hpp"
 #include "base/process.hpp"
 #include "base/convert.hpp"
index 39fb67879b1359961c16bb28ca4d557280a9b3c4..d16ad869d7eb096829dc255d9a8807485b08e8b4 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/service.hpp"
 #include "icinga/macroprocessor.hpp"
 #include "icinga/icingaapplication.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/logger.hpp"
 #include "base/utility.hpp"
 #include "base/process.hpp"
index 79a10be525a4c9cc288e4ef563a67c509a251a21..10459f5954733d33e9a04254f88b6706a080e5a0 100644 (file)
@@ -24,7 +24,7 @@
 #include "icinga/perfdatavalue.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 #include "base/logger.hpp"
 
 using namespace icinga;
index 7960ecd7c47f2c8d382a0c87d422726c1d465cc2..1f10a55c7fac32ee61a644a4b7a39974925eb846 100644 (file)
@@ -18,7 +18,7 @@
  ******************************************************************************/
 
 #include "methods/timeperiodtask.hpp"
-#include "base/scriptfunction.hpp"
+#include "base/function.hpp"
 
 using namespace icinga;