Squashed 'wrap/' changes from 56e7c0c81..24da9d1be

24da9d1be Merge pull request #146 from borglab/fix/matlab
3101236fe fix missing semi-colon for class forward declaration
e933e14a0 add missing boost header

git-subtree-dir: wrap
git-subtree-split: 24da9d1be2b26ecf9abbfd9153b24fbdcf007f4e
release/4.3a0
Varun Agrawal 2022-03-20 22:01:12 -04:00
parent f1e11d0929
commit ea30bc35d5
4 changed files with 8 additions and 8 deletions

View File

@ -412,7 +412,7 @@ class PybindWrapper:
def wrap_instantiated_declaration(
self, instantiated_decl: instantiator.InstantiatedDeclaration):
"""Wrap the class."""
"""Wrap the forward declaration."""
module_var = self._gen_module_var(instantiated_decl.namespaces())
cpp_class = instantiated_decl.to_cpp()
if cpp_class in self.ignore_classes:
@ -420,7 +420,7 @@ class PybindWrapper:
res = (
'\n py::class_<{cpp_class}, '
'{shared_ptr_type}::shared_ptr<{cpp_class}>>({module_var}, "{class_name}")'
'{shared_ptr_type}::shared_ptr<{cpp_class}>>({module_var}, "{class_name}");'
).format(shared_ptr_type=('boost' if self.use_boost else 'std'),
cpp_class=cpp_class,
class_name=instantiated_decl.name,

View File

@ -37,15 +37,16 @@ extern "C" {
#include <mex.h>
}
#include <boost/shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
#include <string>
#include <sstream>
#include <typeinfo>
#include <set>
#include <sstream>
#include <streambuf>
#include <string>
#include <typeinfo>
using namespace std;
using namespace boost; // not usual, but for conciseness of generated code

View File

@ -105,7 +105,7 @@ PYBIND11_MODULE(class_py, m_) {
return redirect.str();
}, py::arg("s") = "factor: ", py::arg("keyFormatter") = gtsam::DefaultKeyFormatter);
py::class_<SuperCoolFactor<gtsam::Pose3>, std::shared_ptr<SuperCoolFactor<gtsam::Pose3>>>(m_, "SuperCoolFactorPose3")
py::class_<SuperCoolFactor<gtsam::Pose3>, std::shared_ptr<SuperCoolFactor<gtsam::Pose3>>>(m_, "SuperCoolFactorPose3");
#include "python/specializations.h"

View File

@ -1,6 +1,5 @@
// A base class
virtual class MyBase {
};
// A templated class