diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-15 16:34:14 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-15 16:34:14 +0100 |
commit | d87b3ca8f1dbcb395f2dfd6540483da7a0e5e15c (patch) | |
tree | 6dd3179162d5cecc474fc9028039bd757f6df04b /include/object.h | |
parent | d8fe9239959dfeae11daa5de70126e30119d3b75 (diff) |
Added the Php::Function class. This is an extension to the Php::Value class that can be used if you want to assign a std::function object to a Value. This is useful if you want to pass a C++ lambda to a PHP userspace function
Diffstat (limited to 'include/object.h')
-rw-r--r-- | include/object.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/object.h b/include/object.h index 0cdeb5c..301fa57 100644 --- a/include/object.h +++ b/include/object.h @@ -54,9 +54,23 @@ public: * } * * @param name Name of the class to instantiate - * @param base Implementation of the class + * @param base C++ object to wrap */ Object(const char *name, Base *base); + + /** + * If you already have the zend_class_entry, you can also pass the + * class_entry structure instead of the class name. This constructor + * works exactly like the Object(name, base) constructor mentioned + * above. + * + * Note that if you normally use PHP-CPP, you do not have the class_entry, + * so you probably need to pass the name anyway + * + * @param entry The PHP class entry + * @param base C++ object to wrap + */ + Object(struct _zend_class_entry *entry, Base *base); /** * Wrap around an object implemented by us |