00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00017
00019
00020
00021
00023
00024 #ifndef _ECLIPSE_H
00025 #define _ECLIPSE_H
00026
00027 #include <python.h>
00028 #include "eclipseray/pymacros.h"
00029
00030
00031
00032
00033
00035 #define ECLIPSE_PURE = 0
00036
00038
00043
00060
00062 class EclipseObject : public PyObject
00063 {
00064 DECLARE_PYTHON_HEADER;
00065
00066 public:
00067
00068
00069
00070
00071
00073 virtual ~EclipseObject();
00074
00076 inline void AddRef(){ m_nReferenceCount++; }
00077
00079 void ReleaseRef();
00080
00082 inline bool IsValid() const { return m_bValidState; }
00083
00084
00085
00086
00087
00088
00089
00095 virtual PYOBJECT PyAsString() ECLIPSE_PURE;
00096
00097
00098
00099
00100
00101
00102
00108 static void PyDestructor( PYOBJECT a_pSelf );
00109
00115 static bool PyTypeCheck( PYOBJECT a_pObject );
00116
00121 static PYOBJECT _PyStringRep( PYOBJECT a_pSelf );
00122
00123
00124 protected:
00125
00127 EclipseObject( PyTypeObject* a_pPythonType );
00128
00133 inline int GetRefCount(){ return m_nReferenceCount; }
00134
00139 inline void SetIsValid( bool a_bIsValid ){ m_bValidState = a_bIsValid; }
00140
00146 virtual void DeleteObject() ECLIPSE_PURE;
00147
00148 private:
00149
00150 int m_nReferenceCount;
00151 bool m_bValidState;
00152
00153 };
00154
00155
00156
00157
00158 #endif