diff options
Diffstat (limited to 'src/member.cpp')
-rw-r--r-- | src/member.cpp | 142 |
1 files changed, 5 insertions, 137 deletions
diff --git a/src/member.cpp b/src/member.cpp index 5a44a74..d4f5d2d 100644 --- a/src/member.cpp +++ b/src/member.cpp @@ -20,8 +20,6 @@ namespace Php { */ Member::Member(const char *name, bool pub) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a null member _info = new NullMember(); } @@ -34,8 +32,6 @@ Member::Member(const char *name, bool pub) : _name(name), _public(pub) */ Member::Member(const char *name, bool pub, std::nullptr_t value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a null member _info = new NullMember(); } @@ -48,8 +44,6 @@ Member::Member(const char *name, bool pub, std::nullptr_t value) : _name(name), */ Member::Member(const char *name, bool pub, int value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a long member _info = new LongMember(value); } @@ -62,8 +56,6 @@ Member::Member(const char *name, bool pub, int value) : _name(name), _public(pub */ Member::Member(const char *name, bool pub, long value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a long member _info = new LongMember(value); } @@ -76,8 +68,6 @@ Member::Member(const char *name, bool pub, long value) : _name(name), _public(pu */ Member::Member(const char *name, bool pub, bool value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a bool member _info = new BoolMember(value); } @@ -90,8 +80,6 @@ Member::Member(const char *name, bool pub, bool value) : _name(name), _public(pu */ Member::Member(const char *name, bool pub, char value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a new string member _info = new StringMember(&value, 1); } @@ -104,8 +92,6 @@ Member::Member(const char *name, bool pub, char value) : _name(name), _public(pu */ Member::Member(const char *name, bool pub, const std::string &value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a new string member _info = new StringMember(value); } @@ -119,8 +105,6 @@ Member::Member(const char *name, bool pub, const std::string &value) : _name(nam */ Member::Member(const char *name, bool pub, const char *value, int size) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a new string member if (size < 0) size = strlen(value); _info = new StringMember(value, size); @@ -134,128 +118,18 @@ Member::Member(const char *name, bool pub, const char *value, int size) : _name( */ Member::Member(const char *name, bool pub, double value) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // create a new double member _info = new DoubleMember(value); } /** * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_0 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_1 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_2 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_3 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_4 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_5 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data + * @param name Name of the method + * @param pub Is this a public method (otherwise it is protected) + * @param method The method to add */ -Member::Member(const char *name, bool pub, method_callback_6 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) +Member::Member(const char *name, bool pub, const _Method &method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) { - std::cout << "Allocate member " << __LINE__ << std::endl; - - // create method member - _info = new MethodMember(name, method, arguments); -} - -/** - * Constructor - * @param name Name of the member - * @param pub Is this a public property (otherwise it is protected) - * @param method The method to call - * @param arguments Argument meta data - */ -Member::Member(const char *name, bool pub, method_callback_7 method, const std::initializer_list<Argument> &arguments) : _name(name), _public(pub) -{ - std::cout << "Allocate member " << __LINE__ << std::endl; - // create method member _info = new MethodMember(name, method, arguments); } @@ -266,8 +140,6 @@ Member::Member(const char *name, bool pub, method_callback_7 method, const std:: */ Member::Member(const Member &member) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // copy info object, and name and public members _info = member._info; _name = member._name; @@ -283,8 +155,6 @@ Member::Member(const Member &member) */ Member::Member(Member &&member) { - std::cout << "Allocate member " << __LINE__ << std::endl; - // move info object, and name and public properties _info = member._info; _name = std::move(member._name); @@ -321,8 +191,6 @@ bool Member::isProperty() */ bool Member::isMethod() { - std::cout << "call isMethod" << std::endl; - return _info && _info->isMethod(); } @@ -345,7 +213,7 @@ void Member::declare(struct _zend_class_entry *entry) void Member::fill(struct _zend_function_entry *entry, const char *classname) { // let the info object do this - _info->fill(entry, classname); + _info->fill(entry, classname, _public); } /** |