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

Go to the source code of this file.

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:68

Definition at line 69 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 78 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 101 of file NekPyConfig.hpp.

◆ SIZENAME

#define SIZENAME (   s)    SIZE_##s

Definition at line 68 of file NekPyConfig.hpp.