diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 22:39:31 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-01 22:39:31 +0100 |
commit | 6abc8b4c062c7333a98830004da894ff81613d5b (patch) | |
tree | 7b11179ef6775130fce0c4ef537fb3656f716852 /include/classbase.h | |
parent | abc3b4fbf996a647bcefb02e4ecf643b659577c9 (diff) |
added possibility to define interfaces, the class::add() method has been renamed to class::method() and class::property() to prevent ambiguity in defining properties and methods
Diffstat (limited to 'include/classbase.h')
-rw-r--r-- | include/classbase.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/include/classbase.h b/include/classbase.h index 98a430e..1cfba83 100644 --- a/include/classbase.h +++ b/include/classbase.h @@ -109,10 +109,19 @@ protected: * @param flags Optional flags * @param args Description of the supported arguments */ - void add(const char *name, method_callback_0, int flags=0, const Arguments &args = {}); - void add(const char *name, method_callback_1, int flags=0, const Arguments &args = {}); - void add(const char *name, method_callback_2, int flags=0, const Arguments &args = {}); - void add(const char *name, method_callback_3, int flags=0, const Arguments &args = {}); + void method(const char *name, method_callback_0, int flags=0, const Arguments &args = {}); + void method(const char *name, method_callback_1, int flags=0, const Arguments &args = {}); + void method(const char *name, method_callback_2, int flags=0, const Arguments &args = {}); + void method(const char *name, method_callback_3, int flags=0, const Arguments &args = {}); + + /** + * Add an abstract method to the class + * + * @param name Name of the method + * @param flags Optional flags (like public or protected) + * @param args Description of the supported arguments + */ + void method(const char *name, int flags=0, const Arguments &args = {}); /** * Add a property to the class @@ -127,15 +136,15 @@ protected: * @param value Actual property value * @param flags Optional flags */ - void add(const char *name, std::nullptr_t value, int flags = Php::Public); - void add(const char *name, int16_t value, int flags = Php::Public); - void add(const char *name, int32_t value, int flags = Php::Public); - void add(const char *name, int64_t value, int flags = Php::Public); - void add(const char *name, bool value, int flags = Php::Public); - void add(const char *name, char value, int flags = Php::Public); - void add(const char *name, const std::string &value, int flags = Php::Public); - void add(const char *name, const char *value, int flags = Php::Public); - void add(const char *name, double value, int flags = Php::Public); + void property(const char *name, std::nullptr_t value, int flags = Php::Public); + void property(const char *name, int16_t value, int flags = Php::Public); + void property(const char *name, int32_t value, int flags = Php::Public); + void property(const char *name, int64_t value, int flags = Php::Public); + void property(const char *name, bool value, int flags = Php::Public); + void property(const char *name, char value, int flags = Php::Public); + void property(const char *name, const std::string &value, int flags = Php::Public); + void property(const char *name, const char *value, int flags = Php::Public); + void property(const char *name, double value, int flags = Php::Public); private: |