Boost logo

Boost Users :

From: Bernhard Glueck (bernhard_at_[hidden])
Date: 2003-02-13 05:35:19


Hi there !

I am a long time user of Boost, and i have a little question. I am
currently developing a C++ based reflection system. which allows me to
call methods of a class over this procedure.

virtual boost::any Call( const std::string & name,std::vector<
boost::any > parameters );

meaning i can call a method like myClass.Call("MyMethod",paramaters ) ;
which will invoke "the myClass.MyMethod method..

This all works perfectly. and i generate "function" stubs using
preprocessor macros in the implementaiton files of my class to map from
boost::any to real data types. e.g

METHOD_DECLARE( myClass,myMethod )
   METHOD_PARAMETER( int );
    METHOD_PARAMETER( std::string )
METHOD_END

which "exports" a method from myclass with the given parameters to be
callbable over the reflection method.

( myClass.myMethod( int, std::string ); )

Now since i am not so very good in programming with templates e.g for
meta programming, i wanted to ask some of the gurus out there :-) if
there is a way to use templates somewhoe to generate this function
stubs...e.g
like in boost:python v.2

so that i only need e.g
class_builder <myClass> mybuilder;
mybuilder.addMethod( &myClass.myMethod,"MyMethod")
and the any to parameter type mapping would be generated automatically ?

I hope i made myself clear about the intention, by the way target
platform is MSVC 7.0/7.1 or Intel C++ 7.0.
( WIN32 all )

Thanks
Bernhard Glueck


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net