c++ - Boost python: Argument Error lvalue between Wrapped and Base class -


in python code below, findfactory returns factorybase instead of factorybasewrapper.
, think may cause of problem.
know how tell python factorybasewrapper inherit factorybase? tried "bases" in class_ this:

class_<factorybasewrapper, bases<factorybase> boost::noncopyable>( "factorybase", no_init ) 

but doesn't compile. seems need make interface factorybase too. can't, need factorybasewrapper because of pure virtual function in factorybase.

thanks

python code:

_sourcefactory = _myfactorymgr.findfactory(name) foo = _sourcefactory.getorcreatebase(myobj) # problem here 

boostpython module:

class_<factorymgr, boost::noncopyable>("factorymgr",no_init)   .def("findfactory",&factorymgr::findfactory, return_value_policy<reference_existing_object>());  class_<factorybasewrapper, boost::noncopyable>( "factorybase", no_init ) .def( "getorcreateindicator", &factorybasewrapper::getorcreateindicator, return_value_policy<reference_existing_object>()) 

cpp functions & classes :

        class factorymgr         {               factorybase* factorymgr::findfactory( const std::string& name );         }         class factorybasewrapper :public factorybase, public wrapper<factorybase>         {            base* factorybase::getorcreatebase ( const customobject* myobj);            base* createbase( string str )            {              return this->get_override( "createbase" )();            }         }          class factorybase         {            virtual base* createbase( string str )=0;            ...         } 

i error:

traceback (most recent call last):   file "xxx", line 149, in yyyy _sourcefactory.getorcreatebase(myobj) boost.python.argumenterror: python argument types in     factorybase.getorcreatebase(factorybase, customobject) did not match c++ signature:     getorcreatebase(factorybasewrapper {lvalue}, interface::customobject const*) 


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -