Hi Simon, Did you export your class ResourceManager to python? If this class not is copyable you can export with some like that:
class_<ClassName, boost::noncopyable>("ClassName") BR Renato On Mon, Jun 15, 2009 at 5:05 PM, Simon Pickles<sipick...@googlemail.com> wrote: > Hi, > > I have a c++ class which uses boost::thread and boost::mutex. > > I cannot expose this class directly with boost::python, since mutex is > non-copyable. > > so I did this: > > /////////////////////////// C++ > class ResourceManager > {}; > > ResourceManager* ResourceManagerFactory() > { > return new ResourceManager(); > } > > def("ResourceManagerFactory", ResourceManagerFactory, > return_value_policy<manage_new_object>()); > > //////////////////// > > > This compiles but I at python runtime I get: > > ##### PYTHON > self.resourceManager = ResourceManagerFactory() > TypeError: No Python class registered for C++ class class ResourceManager > > ##### > > Am I doing this wrong? Wrong return policy? > > Thanks > > Simon > > > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig > -- Renato Araujo Oliveira Filho _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig