diff options
Diffstat (limited to 'src/callable.h')
-rw-r--r-- | src/callable.h | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/callable.h b/src/callable.h index 893dcdb..b6f1e98 100644 --- a/src/callable.h +++ b/src/callable.h @@ -31,22 +31,8 @@ public: * @param flags Optional flags to be passed to the function */ Callable(const std::string &classname, const std::string &function, Type type = nullType, const std::initializer_list<Argument> &arguments = {}, int flags = 0) : - _classname(classname), _type(type), _flags(flags) + _classname(classname), _name(function), _type(type), _flags(flags) { - // somehow "&this" is not accepted by the compiler, so we make a copy - Callable *callable = this; - - // append function name to the data (the data contains a pointer - // to this object, appended with the function name. this is a trick - // so that we have the pointer to this function available in the - // function name by going back a number of bytes) - _data.reserve(function.size() + sizeof(this)); - _data.assign(std::string((const char *)&callable, sizeof(callable))); - _data.append(function); - - // find the name - _name = _data.c_str() + sizeof(this); - // process the arguments process(arguments); } @@ -110,23 +96,17 @@ public: private: /** - * Classname + * Classname (in case of a member function) * @var string */ std::string _classname; /** - * Pointer to current object, appended with function name + * The function name * @var string */ - std::string _data; - - /** - * Pointer to the function name - * @var char* - */ - const char *_name; - + std::string _name; + /** * The return type * @var Type |