Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
cpyrtModule.cxx File Reference
#include "cpyrt.h"
#include "CPPDataMember.h"
#include "CPPExcInstance.h"
#include "CPPInstance.h"
#include "CPPOverload.h"
#include "CPPScope.h"
#include "CallContext.h"
#include "Converters.h"
#include "CustomPyTypes.h"
#include "LowLevelViews.h"
#include "MemoryRegulator.h"
#include "ProxyWrappers.h"
#include "PyStrings.h"
#include "TemplateProxy.h"
#include "TupleOfInstances.h"
#include "Utility.h"
#include "cppjit_interop.h"
#include <unordered_map>
#include "cpyrt/DispatchPtr.h"
#include <algorithm>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
Include dependency graph for cpyrtModule.cxx:

Classes

struct  module_state
 

Namespaces

namespace  cppjit
 
namespace  cppjit::cpyrt
 

Macros

#define CPYRT_INTERNAL   1
 
#define DEFINE_CALL_POLICY_TOGGLE(name, flagname)
 
#define GETSTATE(m)   ((struct module_state*)PyModule_GetState(m))
 

Functions

static int cpycppjitmodule_clear (PyObject *m)
 
static int cpycppjitmodule_traverse (PyObject *m, visitproc visit, void *arg)
 
static void default_dealloc (PyObject *)
 
static PyObject * default_repr (PyObject *)
 
PyObject * cppjit::cpyrt::Init ()
 
CPYRT_EXTERN void * cppjit::cpyrt::Instance_AsVoidPtr (PyObject *pyobject)
 
CPYRT_EXTERN PyObject * cppjit::cpyrt::Instance_FromVoidPtr (void *addr, const std::string &classname, bool python_owns=false)
 
static PyObject * LockInterpreter (PyObject *, PyObject *)
 
static void nullptr_dealloc (PyObject *)
 
static int nullptr_nonzero (PyObject *)
 
static PyObject * nullptr_repr (PyObject *)
 
std::unordered_map< std::string, std::vector< PyObject * > > & cppjit::cpyrt::pythonizations ()
 
static PyObject * UnlockInterpreter (PyObject *, PyObject *)
 

Variables

std::ostringstream cppjit::cpyrt::gCapturedError
 
static PyMethodDef gcpyrtMethods []
 
std::streambuf * cppjit::cpyrt::gOldErrorBuffer = nullptr
 
std::unordered_set< interop::TCppScope_t > cppjit::cpyrt::gPinnedTypes
 
PyObject * cppjit::cpyrt::gPyTypeMap = nullptr
 
static struct PyModuleDef moduledef
 
static PyNumberMethods nullptr_as_number
 
static PyTypeObject PyDefault_t_Type
 
static PyTypeObject PyNullPtr_t_Type
 
std::unordered_map< interop::TCppType_t, interop::TCppType_t > TypeReductionMap
 

Macro Definition Documentation

◆ CPYRT_INTERNAL

#define CPYRT_INTERNAL   1

Definition at line 23 of file cpyrtModule.cxx.

◆ DEFINE_CALL_POLICY_TOGGLE

#define DEFINE_CALL_POLICY_TOGGLE ( name,
flagname )
Value:
static PyObject* name(PyObject*, PyObject* args) { \
PyObject* enabled = 0; \
if (!PyArg_ParseTuple(args, const_cast<char*>("O"), &enabled)) \
return nullptr; \
\
if (CallContext::SetGlobalPolicy(CallContext::flagname, \
PyObject_IsTrue(enabled))) { \
} \
\
}
_object PyObject
char name[80]
Definition TGX11.cxx:142
#define Py_RETURN_TRUE
Definition cpyrt.h:126
#define Py_RETURN_FALSE
Definition cpyrt.h:130
static bool SetGlobalPolicy(ECallFlags e, bool enabled)

Definition at line 755 of file cpyrtModule.cxx.

◆ GETSTATE

#define GETSTATE ( m)    ((struct module_state*)PyModule_GetState(m))

Definition at line 903 of file cpyrtModule.cxx.

Function Documentation

◆ cpycppjitmodule_clear()

static int cpycppjitmodule_clear ( PyObject * m)
static

Definition at line 910 of file cpyrtModule.cxx.

◆ cpycppjitmodule_traverse()

static int cpycppjitmodule_traverse ( PyObject * m,
visitproc visit,
void * arg )
static

Definition at line 905 of file cpyrtModule.cxx.

◆ default_dealloc()

static void default_dealloc ( PyObject * )
static

Definition at line 153 of file cpyrtModule.cxx.

◆ default_repr()

static PyObject * default_repr ( PyObject * )
static

Definition at line 149 of file cpyrtModule.cxx.

◆ LockInterpreter()

static PyObject * LockInterpreter ( PyObject * ,
PyObject *  )
static

Definition at line 825 of file cpyrtModule.cxx.

◆ nullptr_dealloc()

static void nullptr_dealloc ( PyObject * )
static

Definition at line 49 of file cpyrtModule.cxx.

◆ nullptr_nonzero()

static int nullptr_nonzero ( PyObject * )
static

Definition at line 53 of file cpyrtModule.cxx.

◆ nullptr_repr()

static PyObject * nullptr_repr ( PyObject * )
static

Definition at line 45 of file cpyrtModule.cxx.

◆ UnlockInterpreter()

static PyObject * UnlockInterpreter ( PyObject * ,
PyObject *  )
static

Definition at line 835 of file cpyrtModule.cxx.

Variable Documentation

◆ gcpyrtMethods

PyMethodDef gcpyrtMethods[]
static

Definition at line 840 of file cpyrtModule.cxx.

◆ moduledef

struct PyModuleDef moduledef
static
Initial value:
= {
PyModuleDef_HEAD_INIT, "libcppjit", nullptr,
sizeof(struct module_state), gcpyrtMethods, nullptr,
static int cpycppjitmodule_clear(PyObject *m)
static PyMethodDef gcpyrtMethods[]
static int cpycppjitmodule_traverse(PyObject *m, visitproc visit, void *arg)

Definition at line 915 of file cpyrtModule.cxx.

◆ nullptr_as_number

PyNumberMethods nullptr_as_number
static

Definition at line 55 of file cpyrtModule.cxx.

◆ PyDefault_t_Type

PyTypeObject PyDefault_t_Type
static

Definition at line 157 of file cpyrtModule.cxx.

◆ PyNullPtr_t_Type

PyTypeObject PyNullPtr_t_Type
static

Definition at line 94 of file cpyrtModule.cxx.

◆ TypeReductionMap

std::unordered_map<interop::TCppType_t, interop::TCppType_t> TypeReductionMap

Definition at line 42 of file cpyrtModule.cxx.