20 static const std::map<PString, PString> type_to_header = {
21 {
"std::array",
"<nanobind/stl/array.h>"},
22 {
"std::chrono",
"<nanobind/stl/chrono.h>"},
23 {
"std::complex",
"<nanobind/stl/complex.h>"},
24 {
"std::filesystem",
"<nanobind/stl/filesystem.h>"},
25 {
"std::function",
"<nanobind/stl/function.h>"},
26 {
"std::list",
"<nanobind/stl/list.h>"},
27 {
"std::map",
"<nanobind/stl/map.h>"},
28 {
"std::optional",
"<nanobind/stl/optional.h>"},
29 {
"std::pair",
"<nanobind/stl/pair.h>"},
30 {
"std::set",
"<nanobind/stl/set.h>"},
31 {
"std::string",
"<nanobind/stl/string.h>"},
32 {
"std::string_view",
"<nanobind/stl/string_view.h>"},
33 {
"std::wstring",
"<nanobind/stl/wstring.h>"},
34 {
"std::tuple",
"<nanobind/stl/tuple.h>"},
35 {
"std::shared_ptr",
"<nanobind/stl/shared_ptr.h>"},
36 {
"std::unique_ptr",
"<nanobind/stl/unique_ptr.h>"},
37 {
"std::unordered_set",
"<nanobind/stl/unordered_set.h>"},
38 {
"std::unordered_map",
"<nanobind/stl/unordered_map.h>"},
39 {
"std::variant",
"<nanobind/stl/variant.h>"},
40 {
"std::vector",
"<nanobind/stl/vector.h>"},
41 {
"nb::ndarray",
"<nanobind/ndarray.h>"},
42 {
"Eigen::Matrix",
"<nanobind/eigen/dense.h>"},
43 {
"Eigen::Array",
"<nanobind/eigen/dense.h>"},
44 {
"Eigen::Ref",
"<nanobind/eigen/dense.h>"},
45 {
"Eigen::Map",
"<nanobind/eigen/dense.h>"},
46 {
"Eigen::SparseMatrix",
"<nanobind/eigen/sparse.h>"}
49 typedef std::map<PString, PString>::const_iterator MapIt;
50 for(MapIt it = type_to_header.begin(); it != type_to_header.end(); ++it) {
52 PString key = it->first +
"<";
53 if(type.substr(0, key.size()) == key) {
57 if(type == it->first) {
72 for(PVecClassAttribute::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
75 setInclude.insert(
"#include " + header);
PString get_nanobind_include(const PString &type)
std::vector< PClassAttribute > PVecClassAttribute
virtual void headerExtraInclude(std::set< std::string > &setInclude, const PClassConfig &classConfig, const GeneratorMode &mode) const
Add extra include in header.
virtual ~NanobindTraitInclude()
Destructor of NanobindTraitInclude.
NanobindTraitInclude()
Constructor of NanobindTraitInclude.
PAbstractNanobindTraitBackend()
Class to describe a basic class.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.