Is there a way to include all objects in a C ++ header with Boost.Python?

I have the following code:

#include "boost_facade.h" BOOST_PYTHON_MODULE (libdtlinux) { using namespace boost::python; class_<DtSearch>("DtSearch") .def("DoSearch", &DtSearch::DoSearch) .def("CreateIndex", &DtSearch::CreateIndex); } 

I would like Boost to automatically add the class DtSearch and all the helper methods without defining them one by one in BOOST_PYTHON_MODULE .

Is there a way to include the whole object in the header file, or do I just need to specify them, as I am doing now?

Update

SWIG has the functionality I'm looking for, however I need to use Boost.Python. Here is a swig example:

 %module example %{ /* Includes the header in the wrapper code */ #include "header.h" %} /* Parse the header file to generate wrappers */ %include "header.h" 

Link: http://www.swig.org/tutorial.html in SWIG for really lazy

+5
source share

All Articles