32 #include "structmember.h" 35 PyObject *modena_IndexSet = NULL;
39 const char *indexSetId
43 if(!Py_IsInitialized())
51 PyObject *args = PyTuple_New(0);
52 PyObject *kw = Py_BuildValue(
"{s:s}",
"indexSetId", indexSetId);
54 PyObject *pNewObj = PyObject_Call
56 (PyObject *) &modena_index_set_tType,
65 if(PyErr_ExceptionMatches(modena_DoesNotExist))
69 PyObject *pRet = PyObject_CallMethod
76 if(!pRet){ Modena_PyErr_Print(); }
77 int ret = PyInt_AsLong(pRet);
80 modena_error_code = ret;
92 size_t modena_index_set_get_index
98 PyObject *pRet = PyObject_CallMethod
105 if(!pRet){ Modena_PyErr_Print(); }
106 size_t ret = PyInt_AsSsize_t(pRet);
112 const char* modena_index_set_get_name
118 PyObject *pRet = PyObject_CallMethod
125 if(!pRet){ Modena_PyErr_Print(); }
126 const char* ret = PyString_AsString(pRet);
132 size_t modena_index_set_iterator_start
140 size_t modena_index_set_iterator_end
145 PyObject *pRet = PyObject_CallMethod
151 if(!pRet){ Modena_PyErr_Print(); }
152 size_t ret = PyInt_AsSsize_t(pRet);
160 Py_XDECREF(self->pIndexSet);
162 self->ob_type->tp_free((PyObject*)
self);
167 modena_index_set_destroy(
self);
170 static PyMemberDef modena_index_set_t_members[] = {
174 static PyMethodDef modena_index_set_t_methods[] = {
178 static int modena_index_set_t_init
185 PyObject *pIndexSet=NULL;
186 char *indexSetId=NULL;
188 static char *kwlist[] = {
"indexSet",
"indexSetId", NULL};
192 !PyArg_ParseTupleAndKeywords
203 Modena_PyErr_Print();
208 self->pIndexSet = PyObject_CallMethod
218 PyErr_SetString(modena_DoesNotExist,
"Index set does not exist");
220 Modena_PyErr_Print();
225 Py_INCREF(pIndexSet);
226 self->pIndexSet = pIndexSet;
232 static PyObject *modena_index_set_t_new
244 self->pIndexSet = NULL;
247 return (PyObject *)
self;
250 PyTypeObject modena_index_set_tType = {
251 PyObject_HEAD_INIT(NULL)
253 "modena.modena_index_set_t",
256 (destructor)modena_index_set_t_dealloc,
271 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
272 "modena_index_set_t objects",
279 modena_index_set_t_methods,
280 modena_index_set_t_members,
287 (initproc)modena_index_set_t_init,
289 modena_index_set_t_new,
struct modena_index_set_t modena_index_set_t