bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bayonne-devel] call c++ method by string name + passing parameters


From: gafferuk
Subject: [Bayonne-devel] call c++ method by string name + passing parameters
Date: Sat, 16 Jan 2010 21:53:42 -0800 (PST)

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:

callAMethod("bool", "callme", "Harry");

any ideas to get something like that?


-- 
View this message in context: 
http://old.nabble.com/call-c%2B%2B-method-by-string-name-%2B-passing-parameters-tp27196409p27196409.html
Sent from the Gnu - Common C++ mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]