Re: [pygccxml-development] beginnner questions
Brought to you by:
mbaas,
roman_yakovenko
From: Simon W. <wim...@go...> - 2008-03-27 12:26:56
|
This is the generated code: // This file has been generated by Py++. #include "boost/python.hpp" #include "__array_1.pypp.hpp" #include "boost/python/suite/indexing/vector_indexing_suite.hpp" #include "c:/micropather/micropather.h" namespace bp = boost::python; struct Graph_wrapper : micropather::Graph, bp::wrapper< micropather::Graph > { Graph_wrapper() : micropather::Graph() , bp::wrapper< micropather::Graph >(){ // null constructor } virtual void AdjacentCost( void * state, ::std::vector< micropather::StateCost > * adjacent ){ bp::override func_AdjacentCost = this->get_override( "AdjacentCost" ); func_AdjacentCost( state, boost::python::ptr(adjacent) ); } virtual float LeastCostEstimate( void * stateStart, void * stateEnd ){ bp::override func_LeastCostEstimate = this->get_override( "LeastCostEstimate" ); return func_LeastCostEstimate( stateStart, stateEnd ); } virtual void PrintStateInfo( void * state ){ bp::override func_PrintStateInfo = this->get_override( "PrintStateInfo" ); func_PrintStateInfo( state ); } }; struct NodeCost_wrapper : micropather::NodeCost, bp::wrapper< micropather::NodeCost > { NodeCost_wrapper(micropather::NodeCost const & arg ) : micropather::NodeCost( arg ) , bp::wrapper< micropather::NodeCost >(){ // copy constructor } NodeCost_wrapper() : micropather::NodeCost() , bp::wrapper< micropather::NodeCost >(){ // null constructor } static ::micropather::PathNode * get_node(micropather::NodeCost const & inst ){ return inst.node; } static void set_node( micropather::NodeCost & inst, ::micropather::PathNode * new_value ){ inst.node = new_value; } }; struct PathNode_wrapper : micropather::PathNode, bp::wrapper< micropather::PathNode > { static pyplusplus::containers::static_sized::array_1_t< ::micropather::NodeCost, 4> pyplusplus_adjacent_wrapper( ::micropather::PathNode & inst ){ return pyplusplus::containers::static_sized::array_1_t< ::micropather::NodeCost, 4>( inst.adjacent ); } unsigned int get_inClosed() const { return inClosed; } void set_inClosed( unsigned int new_value ){ inClosed = new_value; } unsigned int get_inOpen() const { return inOpen; } void set_inOpen( unsigned int new_value ){ inOpen = new_value; } static ::micropather::PathNode * get_left(micropather::PathNode const & inst ){ return inst.left; } static void set_left( micropather::PathNode & inst, ::micropather::PathNode * new_value ){ inst.left = new_value; } static ::micropather::PathNode * get_next(micropather::PathNode const & inst ){ return inst.next; } static void set_next( micropather::PathNode & inst, ::micropather::PathNode * new_value ){ inst.next = new_value; } static ::micropather::PathNode * get_parent(micropather::PathNode const & inst ){ return inst.parent; } static void set_parent( micropather::PathNode & inst, ::micropather::PathNode * new_value ){ inst.parent = new_value; } static ::micropather::PathNode * get_prev(micropather::PathNode const & inst ){ return inst.prev; } static void set_prev( micropather::PathNode & inst, ::micropather::PathNode * new_value ){ inst.prev = new_value; } }; BOOST_PYTHON_MODULE(micropather){ bp::class_< std::vector< void* > >("vector_less__void_ptr___grate_") .def( bp::vector_indexing_suite< ::std::vector< void* > >() ); { //::std::vector< micropather::StateCost > typedef bp::class_< std::vector< micropather::StateCost > > vector_less__micropather_scope_StateCost__grate__exposer_t; vector_less__micropather_scope_StateCost__grate__exposer_t vector_less__micropather_scope_StateCost__grate__exposer = vector_less__micropather_scope_StateCost__grate__exposer_t( "vector_less__micropather_scope_StateCost__grate_" ); bp::scope vector_less__micropather_scope_StateCost__grate__scope( vector_less__micropather_scope_StateCost__grate__exposer ); //WARNING: the next line of code will not compile, because "::micropather::StateCost" does not have operator== ! //vector_less__micropather_scope_StateCost__grate__exposer.def( bp::vector_indexing_suite< ::std::vector< micropather::StateCost > >() ); } bp::class_< Graph_wrapper, boost::noncopyable >( "Graph" ) .def( "AdjacentCost" , bp::pure_virtual( &::micropather::Graph::AdjacentCost ) , ( bp::arg("state"), bp::arg("adjacent") ) ) .def( "LeastCostEstimate" , bp::pure_virtual( &::micropather::Graph::LeastCostEstimate ) , ( bp::arg("stateStart"), bp::arg("stateEnd") ) ) .def( "PrintStateInfo" , bp::pure_virtual( &::micropather::Graph::PrintStateInfo ) , ( bp::arg("state") ) ); { //::micropather::MicroPather typedef bp::class_< micropather::MicroPather, boost::noncopyable > MicroPather_exposer_t; MicroPather_exposer_t MicroPather_exposer = MicroPather_exposer_t( "MicroPather", bp::init< micropather::Graph *, bp::optional< unsigned int > >(( bp::arg("graph"), bp::arg("allocate")=(unsigned int)(250) )) ); bp::scope MicroPather_scope( MicroPather_exposer ); bp::scope().attr("SOLVED") = (int)micropather::MicroPather::SOLVED; bp::scope().attr("NO_SOLUTION") = (int)micropather::MicroPather::NO_SOLUTION; bp::scope().attr("START_END_SAME") = (int)micropather::MicroPather::START_END_SAME; { //::micropather::MicroPather::Checksum typedef ::UPTR ( ::micropather::MicroPather::*Checksum_function_type )( ) ; MicroPather_exposer.def( "Checksum" , Checksum_function_type( &::micropather::MicroPather::Checksum ) ); } { //::micropather::MicroPather::DumpHashTable typedef void ( ::micropather::MicroPather::*DumpHashTable_function_type )( ) ; MicroPather_exposer.def( "DumpHashTable" , DumpHashTable_function_type( &::micropather::MicroPather::DumpHashTable ) ); } { //::micropather::MicroPather::Reset typedef void ( ::micropather::MicroPather::*Reset_function_type )( ) ; MicroPather_exposer.def( "Reset" , Reset_function_type( &::micropather::MicroPather::Reset ) ); } { //::micropather::MicroPather::Solve typedef int ( ::micropather::MicroPather::*Solve_function_type )( void *,void *,::std::vector< void* > *,float * ) ; MicroPather_exposer.def( "Solve" , Solve_function_type( &::micropather::MicroPather::Solve ) , ( bp::arg("startState"), bp::arg("endState"), bp::arg("path"), bp::arg("totalCost") ) ); } { //::micropather::MicroPather::StatesInPool typedef void ( ::micropather::MicroPather::*StatesInPool_function_type )( ::std::vector< void* > * ) ; MicroPather_exposer.def( "StatesInPool" , StatesInPool_function_type( &::micropather::MicroPather::StatesInPool ) , ( bp::arg("stateVec") ) ); } } bp::class_< NodeCost_wrapper >( "NodeCost" ) .def_readwrite( "cost", µpather::NodeCost::cost ) .add_property( "node" , bp::make_function( (::micropather::PathNode * (*)( ::micropather::NodeCost const & ))(&NodeCost_wrapper::get_node), bp::return_internal_reference< >() ) , bp::make_function( (void (*)( ::micropather::NodeCost &,::micropather::PathNode * ))(&NodeCost_wrapper::set_node), bp::with_custodian_and_ward_postcall< 1, 2 >() ) ); { //::micropather::PathNode typedef bp::class_< PathNode_wrapper, boost::noncopyable > PathNode_exposer_t; PathNode_exposer_t PathNode_exposer = PathNode_exposer_t( "PathNode", bp::no_init ); bp::scope PathNode_scope( PathNode_exposer ); bp::scope().attr("MAX_CACHE") = (int)micropather::PathNode::MAX_CACHE; { //::micropather::PathNode::AddBefore typedef void ( ::micropather::PathNode::*AddBefore_function_type )( ::micropather::PathNode * ) ; PathNode_exposer.def( "AddBefore" , AddBefore_function_type( &::micropather::PathNode::AddBefore ) , ( bp::arg("addThis") ) ); } { //::micropather::PathNode::Init typedef void ( ::micropather::PathNode::*Init_function_type )( unsigned int,void *,float,float,::micropather::PathNode * ) ; PathNode_exposer.def( "Init" , Init_function_type( &::micropather::PathNode::Init ) , ( bp::arg("_frame"), bp::arg("_state"), bp::arg("_costFromStart"), bp::arg("_estToGoal"), bp::arg("_parent") ) ); } { //::micropather::PathNode::Reuse typedef void ( ::micropather::PathNode::*Reuse_function_type )( unsigned int,float,float,::micropather::PathNode * ) ; PathNode_exposer.def( "Reuse" , Reuse_function_type( &::micropather::PathNode::Reuse ) , ( bp::arg("_frame"), bp::arg("_costFromStart"), bp::arg("_estToGoal"), bp::arg("_parent") ) ); } { //::micropather::PathNode::Unlink typedef void ( ::micropather::PathNode::*Unlink_function_type )( ) ; PathNode_exposer.def( "Unlink" , Unlink_function_type( &::micropather::PathNode::Unlink ) ); } pyplusplus::containers::static_sized::register_array_1< ::micropather::NodeCost, 4, bp::return_internal_reference< > >( "__array_1__scope_micropather_scope_NodeCost_4" ); { //micropather::PathNode::adjacent [variable], type=micropather::NodeCost[4] typedef pyplusplus::containers::static_sized::array_1_t< ::micropather::NodeCost, 4> ( *array_wrapper_creator )( ::micropather::PathNode & ); PathNode_exposer.add_property( "adjacent" , bp::make_function( array_wrapper_creator(&PathNode_wrapper::pyplusplus_adjacent_wrapper) , bp::with_custodian_and_ward_postcall< 0, 1 >() ) ); } PathNode_exposer.def_readwrite( "costFromStart", µpather::PathNode::costFromStart ); PathNode_exposer.def_readwrite( "estToGoal", µpather::PathNode::estToGoal ); PathNode_exposer.def_readwrite( "frame", µpather::PathNode::frame ); PathNode_exposer.add_property( "inClosed" , (unsigned int ( PathNode_wrapper::* )( ) const)(&PathNode_wrapper::get_inClosed) , (void ( PathNode_wrapper::* )( unsigned int ) )(&PathNode_wrapper::set_inClosed) ); PathNode_exposer.add_property( "inOpen" , (unsigned int ( PathNode_wrapper::* )( ) const)(&PathNode_wrapper::get_inOpen) , (void ( PathNode_wrapper::* )( unsigned int ) )(&PathNode_wrapper::set_inOpen) ); PathNode_exposer.add_property( "left" , bp::make_function( (::micropather::PathNode * (*)( ::micropather::PathNode const & ))(&PathNode_wrapper::get_left), bp::return_internal_reference< >() ) , bp::make_function( (void (*)( ::micropather::PathNode &,::micropather::PathNode * ))(&PathNode_wrapper::set_left), bp::with_custodian_and_ward_postcall< 1, 2 >() ) ); PathNode_exposer.add_property( "next" , bp::make_function( (::micropather::PathNode * (*)( ::micropather::PathNode const & ))(&PathNode_wrapper::get_next), bp::return_internal_reference< >() ) , bp::make_function( (void (*)( ::micropather::PathNode &,::micropather::PathNode * ))(&PathNode_wrapper::set_next), bp::with_custodian_and_ward_postcall< 1, 2 >() ) ); PathNode_exposer.def_readwrite( "numAdjacent", µpather::PathNode::numAdjacent ); PathNode_exposer.add_property( "parent" , bp::make_function( (::micropather::PathNode * (*)( ::micropather::PathNode const & ))(&PathNode_wrapper::get_parent), bp::return_internal_reference< >() ) , bp::make_function( (void (*)( ::micropather::PathNode &,::micropather::PathNode * ))(&PathNode_wrapper::set_parent), bp::with_custodian_and_ward_postcall< 1, 2 >() ) ); PathNode_exposer.add_property( "prev" , bp::make_function( (::micropather::PathNode * (*)( ::micropather::PathNode const & ))(&PathNode_wrapper::get_prev), bp::return_internal_reference< >() ) , bp::make_function( (void (*)( ::micropather::PathNode &,::micropather::PathNode * ))(&PathNode_wrapper::set_prev), bp::with_custodian_and_ward_postcall< 1, 2 >() ) ); PathNode_exposer.def_readwrite( "totalCost", µpather::PathNode::totalCost ); } bp::class_< micropather::StateCost >( "StateCost" ) .def_readwrite( "cost", µpather::StateCost::cost ); bp::scope().attr("FLT_BIG") = micropather::FLT_BIG; } |