FairShip
Loading...
Searching...
No Matches
pyFairModule.h File Reference
#include <stdexcept>
#include "FairModule.h"
Include dependency graph for pyFairModule.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pyFairModule
 

Typedefs

typedef _object PyObject
 

Functions

void call_python_method (PyObject *self, const char *method)
 

Typedef Documentation

◆ PyObject

typedef _object PyObject

Definition at line 9 of file pyFairModule.h.

Function Documentation

◆ call_python_method()

void call_python_method ( PyObject self,
const char *  method 
)

Definition at line 10 of file pyFairModule.cxx.

10 {
11 // check arguments
12 if (0 == self || 0 == method) {
13 throw std::runtime_error("Invalid Python object and method");
14 }
15 // call Python
16 PyObject* r = PyObject_CallMethod(self, const_cast<char*>(method),
17 const_cast<char*>(""));
18 if (0 == r) {
19 PyErr_Print();
20 return;
21 }
22 // release used objects
23 Py_XDECREF(r);
24 //
25 return;
26}
_object PyObject
Definition: pyFairModule.h:9