From MAILER-DAEMON Mon Jan 18 10:04:57 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NWtA1-0004dY-AR
	for mharc-bug-commoncpp@gnu.org; Mon, 18 Jan 2010 10:04:57 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NWO57-0007vz-KZ
	for bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:53:49 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NWO53-0007rg-4Z
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:53:49 -0500
Received: from [199.232.76.173] (port=47323 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NWO53-0007rc-2P
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:53:45 -0500
Received: from kuber.nabble.com ([216.139.236.158]:60486)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NWO52-0005fN-KQ
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:53:44 -0500
Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NWO50-0004mi-Ih
	for Bug-commoncpp@gnu.org; Sat, 16 Jan 2010 21:53:42 -0800
Message-ID: <27196409.post@talk.nabble.com>
Date: Sat, 16 Jan 2010 21:53:42 -0800 (PST)
From: gafferuk <gafferuk@gmail.com>
To: Bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: gafferuk@gmail.com
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Mon, 18 Jan 2010 10:04:54 -0500
Cc: 
Subject: [Bayonne-devel] call c++ method by string name + passing parameters
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2010 05:53:49 -0000


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.




From MAILER-DAEMON Mon Jan 18 10:04:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NWtA1-0004eC-V3
	for mharc-bug-commoncpp@gnu.org; Mon, 18 Jan 2010 10:04:58 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NWOH5-0004Ra-0R
	for bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:06:11 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NWOGz-0004Nk-Az
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:06:09 -0500
Received: from [199.232.76.173] (port=54499 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NWOGz-0004Ne-5Z
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:06:05 -0500
Received: from kuber.nabble.com ([216.139.236.158]:52919)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NWOGy-0006ZG-Hs
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:06:04 -0500
Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NWOGw-0005iL-BZ
	for Bug-commoncpp@gnu.org; Sat, 16 Jan 2010 22:06:02 -0800
Message-ID: <27196409.post@talk.nabble.com>
Date: Sat, 16 Jan 2010 22:06:02 -0800 (PST)
From: gafferuk <gafferuk@gmail.com>
To: Bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: gafferuk@gmail.com
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Mon, 18 Jan 2010 10:04:55 -0500
Cc: 
Subject: [Bayonne-devel] call c++ method by string name + passing parameters
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2010 06:06:11 -0000


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?


-- 
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.




From MAILER-DAEMON Mon Jan 18 10:04:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NWtA1-0004dn-JG
	for mharc-bug-commoncpp@gnu.org; Mon, 18 Jan 2010 10:04:57 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NWO75-0000Jq-Ko
	for bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:55:51 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NWO70-0000Io-OG
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:55:51 -0500
Received: from [199.232.76.173] (port=47350 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NWO70-0000Ii-IZ
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:55:46 -0500
Received: from kuber.nabble.com ([216.139.236.158]:60494)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NWO6z-0005oh-Uz
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:55:46 -0500
Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NWO6y-0004uZ-AB
	for Bug-commoncpp@gnu.org; Sat, 16 Jan 2010 21:55:44 -0800
Message-ID: <27196409.post@talk.nabble.com>
Date: Sat, 16 Jan 2010 21:55:44 -0800 (PST)
From: gafferuk <gafferuk@gmail.com>
To: Bug-commoncpp@gnu.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: gafferuk@gmail.com
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Mon, 18 Jan 2010 10:04:55 -0500
Cc: 
Subject: [Bayonne-devel] call c++ method by string name + passing parameters
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2010 05:55:52 -0000


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("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.




From MAILER-DAEMON Mon Jan 18 10:04:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NWtA2-0004ei-4W
	for mharc-bug-commoncpp@gnu.org; Mon, 18 Jan 2010 10:04:58 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NWOaI-00044c-Ib
	for bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:26:02 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NWOaD-000432-B1
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:26:01 -0500
Received: from [199.232.76.173] (port=51656 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NWOaD-00042t-89
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:25:57 -0500
Received: from kuber.nabble.com ([216.139.236.158]:43768)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NWOaC-0007y1-Pl
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 01:25:57 -0500
Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NWOaB-0006ry-AX
	for Bug-commoncpp@gnu.org; Sat, 16 Jan 2010 22:25:55 -0800
Message-ID: <27196499.post@talk.nabble.com>
Date: Sat, 16 Jan 2010 22:25:55 -0800 (PST)
From: gafferuk <gafferuk@gmail.com>
To: Bug-commoncpp@gnu.org
In-Reply-To: <27196409.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: gafferuk@gmail.com
References: <27196409.post@talk.nabble.com>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Mon, 18 Jan 2010 10:04:55 -0500
Cc: 
Subject: Re: [Bayonne-devel] call c++ method by string name + passing
 parameters
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2010 06:26:03 -0000




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




From MAILER-DAEMON Mon Jan 18 10:04:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NWtA2-0004eu-CA
	for mharc-bug-commoncpp@gnu.org; Mon, 18 Jan 2010 10:04:58 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NWQQa-0003nm-17
	for bug-commoncpp@gnu.org; Sun, 17 Jan 2010 03:24:08 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1NWQQV-0003m7-87
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 03:24:07 -0500
Received: from [199.232.76.173] (port=32906 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NWQQV-0003m1-4s
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 03:24:03 -0500
Received: from mx20.gnu.org ([199.232.41.8]:55102)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <bounces@nabble.com>) id 1NWQQU-0008PC-Kq
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 03:24:02 -0500
Received: from kuber.nabble.com ([216.139.236.158])
	by mx20.gnu.org with esmtp (Exim 4.60)
	(envelope-from <bounces@nabble.com>) id 1NWQQU-0005Lc-0Z
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 03:24:02 -0500
Received: from isper.nabble.com ([192.168.236.156])
	by kuber.nabble.com with esmtp (Exim 4.63)
	(envelope-from <bounces@nabble.com>) id 1NWQQM-0005jo-NM
	for Bug-commoncpp@gnu.org; Sun, 17 Jan 2010 00:23:54 -0800
Message-ID: <27196913.post@talk.nabble.com>
Date: Sun, 17 Jan 2010 00:23:54 -0800 (PST)
From: gafferuk <gafferuk@gmail.com>
To: Bug-commoncpp@gnu.org
In-Reply-To: <27196499.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Nabble-From: gafferuk@gmail.com
References: <27196409.post@talk.nabble.com> <27196499.post@talk.nabble.com>
X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Mailman-Approved-At: Mon, 18 Jan 2010 10:04:55 -0500
Cc: 
Subject: Re: [Bayonne-devel] call c++ method by string name + passing
 parameters
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jan 2010 08:24:08 -0000




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.




