From: Fernando L. <fer...@gm...> - 2010-04-09 14:27:39
|
Two questions ... a) How can I pass a pointer to a new type object? b) Can I access methods from this pointer? Like in class Block : Public PythonClass<Block> { Block *parent; Block(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds): : Py::PythonClass< Block >::PythonClass( self, args, kwds ) { args.verify_length(1); // Is this possible ??? or something like this parent = (Block*) args[0]; } ... ... Py::Object getFullName( void ) { std::string r = ""; if( ! parent->isNone() ) r += Py::String( parent->getFullName()).as_std_string( "utf-8" ) + "."; /* I want to access parent's methods directly to avoid the overload of calling callMemberFunction("getFullName") and many others that I need. Is it possible? Is callMemberFunction restricted to the exposed ones? */ r += name.as_std_string( "utf-8" ); return Py::String(r); } ... ... }; -- Fernando Libonati fernando.libonati at gmail.com |