From 708e9cf9da9571a38ac8d2529d016cd78ce8ec54 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sat, 31 Aug 2013 08:09:51 -0700 Subject: {auto} work in progress --- src/callable.h | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'src/callable.h') 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 &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 -- cgit v1.2.3