+ inline ePyObject();
+ inline ePyObject(const ePyObject &ob);
+ inline ePyObject(PyObject *ob);
+#ifdef PYTHON_REFCOUNT_DEBUG
+ inline ePyObject(PyObject *ob, const char *file, int line);
+#endif
+ inline ePyObject(PyDictObject *ob);
+ inline ePyObject(PyTupleObject *ob);
+ inline ePyObject(PyListObject *ob);
+ inline ePyObject(PyStringObject *ob);
+ operator bool() const { return !!m_ob; }
+ operator bool() { return !!m_ob; }
+ ePyObject &operator=(const ePyObject &);
+ ePyObject &operator=(PyObject *);
+ ePyObject &operator=(PyDictObject *ob) { return operator=((PyObject*)ob); }
+ ePyObject &operator=(PyTupleObject *ob) { return operator=((PyObject*)ob); }
+ ePyObject &operator=(PyListObject *ob) { return operator=((PyObject*)ob); }
+ ePyObject &operator=(PyStringObject *ob) { return operator=((PyObject*)ob); }
+ operator PyObject*();
+ operator PyTupleObject*() { return (PyTupleObject*)operator PyObject*(); }
+ operator PyListObject*() { return (PyListObject*)operator PyObject*(); }
+ operator PyStringObject*() { return (PyStringObject*)operator PyObject*(); }
+ operator PyDictObject*() { return (PyDictObject*)operator PyObject*(); }
+ PyObject *operator->() { return operator PyObject*(); }
+#ifdef PYTHON_REFCOUNT_DEBUG
+ void incref(const char *file, int line);
+ void decref(const char *file, int line);
+#else
+ void incref();
+ void decref();
+#endif
+};
+
+inline ePyObject::ePyObject()
+ :m_ob(0)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+inline ePyObject::ePyObject(const ePyObject &ob)
+ :m_ob(ob.m_ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(ob.m_file), m_line(ob.m_line)
+ ,m_from(ob.m_from), m_to(ob.m_to), m_erased(ob.m_erased)
+#endif
+{
+}
+
+inline ePyObject::ePyObject(PyObject *ob)
+ :m_ob(ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+#ifdef PYTHON_REFCOUNT_DEBUG
+inline ePyObject::ePyObject(PyObject *ob, const char* file, int line)
+ :m_ob(ob)
+ ,m_file(file), m_line(line), m_from(ob->ob_refcnt), m_to(ob->ob_refcnt), m_erased(false)
+{
+}
+#endif
+
+inline ePyObject::ePyObject(PyDictObject *ob)
+ :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+inline ePyObject::ePyObject(PyTupleObject *ob)
+ :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+inline ePyObject::ePyObject(PyListObject *ob)
+ :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+inline ePyObject::ePyObject(PyStringObject *ob)
+ :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
+#ifndef PYTHON_REFCOUNT_DEBUG
+inline ePyObject &ePyObject::operator=(PyObject *ob)
+{
+ m_ob=ob;
+ return *this;
+}
+
+inline ePyObject &ePyObject::operator=(const ePyObject &ob)
+{
+ m_ob=ob.m_ob;
+ return *this;
+}
+
+inline ePyObject::operator PyObject*()
+{
+ return m_ob;
+}
+
+inline void ePyObject::incref()
+{
+ Py_INCREF(m_ob);
+}
+
+inline void ePyObject::decref()
+{
+ Py_DECREF(m_ob);
+}
+
+#endif // ! PYTHON_REFCOUNT_DEBUG
+
+#endif // !SWIG && !SKIP_PART1
+
+#ifndef SKIP_PART2
+#ifndef SWIG
+#ifdef PYTHON_REFCOUNT_DEBUG
+inline void Impl_Py_DECREF(const char* file, int line, const ePyObject &obj)
+{
+ ((ePyObject*)(&obj))->decref(file, line);
+}
+
+inline void Impl_Py_INCREF(const char* file, int line, const ePyObject &obj)
+{
+ ((ePyObject*)(&obj))->incref(file, line);
+}
+
+inline void Impl_Py_XDECREF(const char* file, int line, const ePyObject &obj)
+{
+ if (obj)
+ ((ePyObject*)(&obj))->decref(file, line);
+}
+
+inline void Impl_Py_XINCREF(const char* file, int line, const ePyObject &obj)
+{
+ if (obj)
+ ((ePyObject*)(&obj))->incref(file, line);
+}
+
+inline ePyObject Impl_PyTuple_New(const char* file, int line, int elements=0)
+{
+ return ePyObject(PyTuple_New(elements), file, line);
+}
+
+inline ePyObject Impl_PyList_New(const char* file, int line, int elements=0)
+{
+ return ePyObject(PyList_New(elements), file, line);
+}
+
+inline ePyObject Impl_PyDict_New(const char* file, int line)
+{
+ return ePyObject(PyDict_New(), file, line);
+}
+
+inline ePyObject Impl_PyString_FromString(const char* file, int line, const char *str)
+{
+ return ePyObject(PyString_FromString(str), file, line);
+}
+
+inline ePyObject Impl_PyString_FromFormat(const char* file, int line, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ PyObject *ob = PyString_FromFormatV(fmt, ap);
+ va_end(ap);
+ return ePyObject(ob, file, line);
+}