7 #ifndef BALL_PYTHON_PYLIST_HELPER
8 #define BALL_PYTHON_PYLIST_HELPER
18 #define BALL_CONVERT_LIST_FROM(TYPE)\
21 if ((pl = PyList_New(0)) == NULL) return NULL;\
23 for (TYPE##List::const_iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)\
25 PyObject *inst = BALL_CONVERT_FROM_INSTANCE(*it, TYPE, 0);\
27 if (inst == NULL || PyList_Append(pl,inst) < 0)\
38 #define BALL_CONVERT_LIST_TO(TYPE)\
39 if (sipIsErr == NULL) return PyList_Check(sipPy);\
41 TYPE##List* alist = new TYPE##List;\
43 for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)\
45 TYPE* a = reinterpret_cast<TYPE*>(BALL_FORCE_CONVERT_TO_TYPE(PyList_GET_ITEM(sipPy,i), TYPE));\
std::list< RegularData3D * > RegularData3DList