summaryrefslogtreecommitdiff
path: root/src/functions.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-25 23:10:15 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-25 23:10:15 +0200
commit9ba4fb9ae4233a656bbfca1b169b0a608202b717 (patch)
tree0ccad56abc640ace7c97847552ff99702e16c577 /src/functions.h
parente14055694478d70e58b5fc653b08a9a514bbc455 (diff)
By hiding a pointer to the callable object in front of the function name we have managed to retrieve back the callable object, so we can pass all callbacks to one single function, which will further deliver them to the appropriate function object
Diffstat (limited to 'src/functions.h')
-rw-r--r--src/functions.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/functions.h b/src/functions.h
index 9b28ca2..bc08b8a 100644
--- a/src/functions.h
+++ b/src/functions.h
@@ -23,7 +23,7 @@ public:
* Constructor
* @param functions The functions to parse
*/
- Functions(const std::initializer_list<Function> &functions)
+ Functions(const std::initializer_list<Function> &functions) : _functions(functions)
{
// allocate the function entries
_entries = new zend_function_entry[functions.size() + 1];
@@ -69,6 +69,13 @@ private:
* @var zend_function_entry*
*/
zend_function_entry *_entries;
+
+ /**
+ * Vector of functions (we need this because the function objects must
+ * remain in memory)
+ * @var vector
+ */
+ std::vector<Function> _functions;
};
/**
@@ -76,5 +83,3 @@ private:
*/
}
-
- \ No newline at end of file