diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-02-28 10:25:01 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-02-28 10:25:01 +0100 |
commit | 71055ebdea1e8eec30747a04f36e0c10e750bff5 (patch) | |
tree | 18ed63d5fe64a936c284a38d4f72921a4ddc97df /src/members.cpp | |
parent | 85349bbb642a83012a7d0dbccde8b7c1eea1b914 (diff) |
a lot of refactoring, to make it much easier to define classes in an extension
Diffstat (limited to 'src/members.cpp')
-rw-r--r-- | src/members.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/src/members.cpp b/src/members.cpp index 4ff1b60..1965807 100644 --- a/src/members.cpp +++ b/src/members.cpp @@ -13,76 +13,76 @@ */ namespace Php { -/** - * Destructor - */ -Members::~Members() -{ - // check if there are methods - if (_methods) delete[] _methods; -} - -/** - * Number of methods - * @return integer - */ -int Members::methods() -{ - // result variable - int result = 0; - - // loop through the functions - for (auto it = begin(); it != end(); it++) - { - // check if this is a method - if (it->isMethod()) result++; - } - - // done - return result; -} - -/** - * Get access to the methods - * @return Methods - */ -struct _zend_function_entry *Members::methods(const char *classname) -{ - // already set? - if (_methods) return _methods; - - // the number of methods - int count = methods(); - - // allocate memory for the functions - _methods = new zend_function_entry[count + 1]; - - // keep iterator counter - int i = 0; - - // loop through the functions - for (auto it = begin(); it != end(); it++) - { - // skip if this is not a method - if (!it->isMethod()) continue; - - // retrieve entry - zend_function_entry *entry = &_methods[i++]; - - // let the function fill the entry - it->fill(entry, classname); - } - - // last entry should be set to all zeros - zend_function_entry *last = &_methods[i]; - - // all should be set to zero - memset(last, 0, sizeof(zend_function_entry)); - - // done - return _methods; -} - +///** +// * Destructor +// */ +//Members::~Members() +//{ +// // check if there are methods +// if (_methods) delete[] _methods; +//} +// +///** +// * Number of methods +// * @return integer +// */ +//int Members::methods() +//{ +// // result variable +// int result = 0; +// +// // loop through the functions +// for (auto it = begin(); it != end(); it++) +// { +// // check if this is a method +// if (it->isMethod()) result++; +// } +// +// // done +// return result; +//} +// +///** +// * Get access to the methods +// * @return Methods +// */ +//struct _zend_function_entry *Members::methods(const char *classname) +//{ +// // already set? +// if (_methods) return _methods; +// +// // the number of methods +// int count = methods(); +// +// // allocate memory for the functions +// _methods = new zend_function_entry[count + 1]; +// +// // keep iterator counter +// int i = 0; +// +// // loop through the functions +// for (auto it = begin(); it != end(); it++) +// { +// // skip if this is not a method +// if (!it->isMethod()) continue; +// +// // retrieve entry +// zend_function_entry *entry = &_methods[i++]; +// +// // let the function fill the entry +// it->initialize(classname, entry); +// } +// +// // last entry should be set to all zeros +// zend_function_entry *last = &_methods[i]; +// +// // all should be set to zero +// memset(last, 0, sizeof(zend_function_entry)); +// +// // done +// return _methods; +//} +// /** * End of namespace */ |