FWIW Finally had a chance to get back to this and found a way to make it work.<br>
<br>
If I remove the implicit conversion from smart_ptr<Factory> to
smart_ptr<Factory_wrapper> in the base class export all is good. <br>
<br>
Not sure why that leads to the loop and seg fault if you derive from BasicFactory in python though. <br>
<br><br><div><span class="gmail_quote">On 8/19/05, <b class="gmail_sendername">Scott McKay</b> <<a href="mailto:skottmckay@gmail.com">skottmckay@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>That has led me to a question on what is required in terms of implicit<br>conversion calls to handle classes in the same hierarchy that are<br>wrapped with wrapper<> and held by smart pointers. I can't seem to<br>
find a combination to allow derivation from both Factory and<br>BasicFactory.<br><br>void Export_Factory()<br>{<br> class_< Factory_Wrapper, smart_ptr< Factory_Wrapper > >("Factory",<br>init< >())
<br> .def("generate", &Factory::generate,<br>&Factory_Wrapper::default_generate, return_self<>())<br> .def(init< const Factory& >())<br> ;<br><br> implicitly_convertible< smart_ptr< Factory_Wrapper >, smart_ptr<
<br>Factory > >();<br> implicitly_convertible< smart_ptr< Factory >, smart_ptr<<br>Factory_Wrapper > >();<br>}<br><br><br><br>void Export_BasicFactory()<br>{<br> class_< BasicFactory_Wrapper, bases< Factory > , smart_ptr<
<br>BasicFactory_Wrapper > >("BasicFactory", init< >())<br> .def("generate", (Factory& (BasicFactory::*)(SourceGroup&)<br>)&BasicFactory::generate, (Factory&<br>(BasicFactory_Wrapper::*)(SourceGroup&))&BasicFactory_Wrapper::default_generate,
<br>return_self<>())<br> .def(init< const BasicFactory& >())<br> ;<br><br> implicitly_convertible< smart_ptr< BasicFactory_Wrapper >,<br>smart_ptr< Factory > >();<br> implicitly_convertible< smart_ptr< Factory >, smart_ptr<
<br>BasicFactory_Wrapper > >();<br>}<br><br>
</blockquote></div><br>