[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bayonne-devel] call c++ method by string name + passing parameters
From: |
gafferuk |
Subject: |
Re: [Bayonne-devel] call c++ method by string name + passing parameters |
Date: |
Sun, 17 Jan 2010 00:23:54 -0800 (PST) |
gafferuk wrote:
>
>
>
> gafferuk wrote:
>>
>> Im trying to create my own scripting engine/language.
>>
>> Is it possible to call a c++ class method by string name and also pass in
>> the parameters?
>>
>> for example I have a class called MyClass with a method called callme:
>>
>> bool MyClass::callme(string name)
>> {
>> cout << "Hello " << name.c_str() << "\n";
>>
>> return true;
>> }
>>
>> Normally would call it by using:
>>
>> bool res = myClass->callMe("Harry");
>>
>> what I want is a command like:
>>
>> bool res = callAMethod("MyClass", "callme", "Harry");
>>
>> any ideas to get something like that?
>>
>>
>>
>
> found what i need:
>
> http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
>
thats not what i need, that for c# not c++.
can anyone help with my original question?
--
View this message in context:
http://old.nabble.com/call-c%2B%2B-method-by-string-name-%2B-passing-parameters-tp27196409p27196913.html
Sent from the Gnu - Common C++ mailing list archive at Nabble.com.