Nektar++
Classes | Macros
NekPyConfig.hpp File Reference
#include <boost/version.hpp>
#include <memory>
#include "ShPtrFixes.hpp"
#include "FunctorSignature.hpp"
#include <boost/numpy.hpp>
#include <boost/python.hpp>

Go to the source code of this file.

Classes

struct  CppCommandLine
 Helper structure to construct C++ command line argc and argv variables from a Python list. More...
 
struct  WrapConverter< T >
 A helper class that for factory-based classes allows std::shared_ptr<T> as something that boost::python recognises, otherwise modules constructed from the factory will not work from Python. More...
 

Macros

#define SIZENAME(s)   SIZE_##s
 
#define NEKPY_WRAP_ENUM(ENUMNAME, MAPNAME)
 
#define NEKPY_WRAP_ENUM_STRING(ENUMNAME, MAPNAME)
 
#define NEKPY_WRAP_ENUM_STRING_DOCS(ENUMNAME, MAPNAME, DOCSTRING)
 

Macro Definition Documentation

◆ NEKPY_WRAP_ENUM

#define NEKPY_WRAP_ENUM (   ENUMNAME,
  MAPNAME 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(#ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a], (ENUMNAME)a); \
} \
tmp.export_values(); \
}
#define SIZENAME(s)
Definition: NekPyConfig.hpp:70

Definition at line 71 of file NekPyConfig.hpp.

◆ NEKPY_WRAP_ENUM_STRING

#define NEKPY_WRAP_ENUM_STRING (   ENUMNAME,
  MAPNAME 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(#ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a].c_str(), (ENUMNAME)a); \
} \
tmp.export_values(); \
}

Definition at line 80 of file NekPyConfig.hpp.

◆ NEKPY_WRAP_ENUM_STRING_DOCS

#define NEKPY_WRAP_ENUM_STRING_DOCS (   ENUMNAME,
  MAPNAME,
  DOCSTRING 
)
Value:
{ \
py::enum_<ENUMNAME> tmp(#ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a].c_str(), (ENUMNAME)a); \
} \
tmp.export_values(); \
PyTypeObject *pto = reinterpret_cast<PyTypeObject *>(tmp.ptr()); \
PyDict_SetItemString(pto->tp_dict, "__doc__", \
PyUnicode_FromString(DOCSTRING)); \
}

Definition at line 103 of file NekPyConfig.hpp.

◆ SIZENAME

#define SIZENAME (   s)    SIZE_##s

Definition at line 70 of file NekPyConfig.hpp.