mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
added support for sharing of extension_classes across modules
[SVN r8399]
This commit is contained in:
19
shared_modules/shared.cpp
Normal file
19
shared_modules/shared.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "boost/python/module_builder.hpp"
|
||||
#include "boost/python/class_builder.hpp"
|
||||
#include "shared.hpp"
|
||||
|
||||
namespace py = boost::python;
|
||||
|
||||
char const * test(Shared const & m)
|
||||
{
|
||||
return m.name();
|
||||
}
|
||||
|
||||
extern "C" void initshared()
|
||||
{
|
||||
py::module_builder shared("shared");
|
||||
py::class_builder<Shared> shared_class(shared, "Shared");
|
||||
shared_class.def(py::constructor<>());
|
||||
shared_class.def(&Shared::name, "name");
|
||||
shared.def(&test, "test");
|
||||
}
|
||||
Reference in New Issue
Block a user