diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-12 19:47:43 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-12 19:47:43 +0100 |
commit | fa387f9bef0d1a70a4b40c28c5cf9d661c421f73 (patch) | |
tree | c1857d0d7fc0a8db8c1f3a841913b1f496d8e661 /src/core/common/Function.hpp | |
parent | 2b15fcab4b81fa8a854e724c48ee9c771fb126f8 (diff) | |
parent | 55f943ba1b31542157b984b5955b91261c280f46 (diff) |
Merge branch 'master' of somweyr.de:ousia
Conflicts:
application/src/core/model/Document.hpp
Diffstat (limited to 'src/core/common/Function.hpp')
-rw-r--r-- | src/core/common/Function.hpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/core/common/Function.hpp b/src/core/common/Function.hpp index 04030c8..79ee6b9 100644 --- a/src/core/common/Function.hpp +++ b/src/core/common/Function.hpp @@ -42,7 +42,7 @@ namespace ousia { */ class Function { protected: - Function() {}; + Function(){}; public: Function(const Function &) = delete; @@ -62,6 +62,23 @@ public: }; /** + * Function doing nothing. Instances of this class are used as default values + * for instances of the Function class. + */ +class FunctionStub : public Function { +public: + /** + * Constructor of the FunctionStub class. + */ + FunctionStub() {} + + Variant call(const Variant::arrayType &, void *) const override + { + return nullptr; + } +}; + +/** * The Method class refers to a method in the C++ code, belonging to an object * of a certain type T. * @@ -93,7 +110,7 @@ public: * * @param method is a pointer at the C++ function that should be called. */ - Method(Callback method) : method(method) {}; + Method(Callback method) : method(method){}; /** * Calls the underlying method. @@ -106,7 +123,7 @@ public: void *thisRef = nullptr) const override { // Call the method - return method(args, static_cast<T*>(thisRef)); + return method(args, static_cast<T *>(thisRef)); } }; } |