summaryrefslogtreecommitdiff
path: root/src/callable.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-31 08:09:51 -0700
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2013-08-31 08:09:51 -0700
commit708e9cf9da9571a38ac8d2529d016cd78ce8ec54 (patch)
treedaa1bd156b2eaa7259f5b29753a94e879b54710d /src/callable.h
parentc2343400688366e567f67e89a50d573786f98bec (diff)
{auto} work in progress
Diffstat (limited to 'src/callable.h')
-rw-r--r--src/callable.h30
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