#include "pythonForwardDeclarations.hpp"
#include "../system.hpp"
#include "../Macros.hpp"
#include "../limits.hpp"
#include <vector>
#include <stdexcept>
Go to the source code of this file.
|
| #define | PYTHON_ERROR_IF(CONDITION, TYPE, MSG, RET) static_assert( false, "You are attempting to use PYTHON_ERROR_IF but haven't yet included Python.hpp" ) |
| | Raise a Python exception if CONDITION is met. More...
|
| |
|
| enum | LvArray::python::PyModify { READ_ONLY = 0,
MODIFIABLE = 1,
RESIZEABLE = 2
} |
| | An enumeration of the various access policies for Python objects.
|
| |
|
| void | LvArray::python::internal::xincref (PyObject *const obj) |
| | A wrapper around Py_XINCREF. More...
|
| |
| void | LvArray::python::internal::xdecref (PyObject *const obj) |
| | A wrapper around Py_XDECREF. More...
|
| |
| bool | LvArray::python::internal::isInstanceOf (PyObject *const obj, PyTypeObject *type) |
| | Return true if obj is an instance of type. More...
|
| |
| template<typename T > |
| T * | LvArray::python::convert (PyObject *const obj, PyTypeObject *const type) |
| | Return obj casted to T if obj is an instance of type or nullptr if it is not. More...
|
| |
| bool | LvArray::python::addTypeToModule (PyObject *const module, PyTypeObject *const type, char const *const typeName) |
| | Add the Python type type to the module module. More...
|
| |
| PyObject * | LvArray::python::create (std::string const &value) |
| | Return a Python string copy of value. More...
|
| |
| PyObject * | LvArray::python::createPyListOfStrings (std::string const *const strptr, long long const size) |
| | Create and return a Python list of strings from an array of std::strings. The Python strings will be copies. More...
|
| |
| PyObject * | LvArray::python::create (std::vector< std::string > const &vec) |
| | Create and return a Python list of strings from a std::vector of std::strings. The Python strings will be copies. More...
|
| |
◆ PYTHON_ERROR_IF
| #define PYTHON_ERROR_IF |
( |
|
CONDITION, |
|
|
|
TYPE, |
|
|
|
MSG, |
|
|
|
RET |
|
) |
| static_assert( false, "You are attempting to use PYTHON_ERROR_IF but haven't yet included Python.hpp" ) |
Raise a Python exception if CONDITION is met.
- Parameters
-
| CONDITION | The condition to check. |
| TYPE | The Type of Python exception to raise. |
| MSG | The message to give the exception. |
| RET | The return value if there was an error. |
◆ isInstanceOf()
| bool LvArray::python::internal::isInstanceOf |
( |
PyObject *const |
obj, |
|
|
PyTypeObject * |
type |
|
) |
| |
Return true if obj is an instance of type.
- Parameters
-
| obj | The object. |
| type | The type. |
- Returns
true if obj is an instance of type.
◆ xdecref()
| void LvArray::python::internal::xdecref |
( |
PyObject *const |
obj | ) |
|
A wrapper around Py_XDECREF.
- Parameters
-
| obj | The object to decrease the reference count of, may be a nullptr. |
◆ xincref()
| void LvArray::python::internal::xincref |
( |
PyObject *const |
obj | ) |
|
A wrapper around Py_XINCREF.
- Parameters
-
| obj | The object to increase the reference count of, may be a nullptr. |