From: John L. <jr...@us...> - 2006-09-07 22:42:23
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4262/wxLua/modules/wxluadebug/include Modified Files: staktree.h wxldebug.h Log Message: make wxLuaDebugData derived from wxObject and ref counted so we don't have to remember to delete it or check NULL make the wxTread in wxLuaDebugServer part of the class as wxLuaDebugTarget does Index: staktree.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/staktree.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** staktree.h 5 Sep 2006 21:48:11 -0000 1.10 --- staktree.h 7 Sep 2006 22:42:19 -0000 1.11 *************** *** 69,75 **** void SizeWindow(int nWidth, int nHeight); ! void FillStackCombobox(const wxLuaDebugData *pDebugData); ! void FillStackEntry(int nEntry, const wxLuaDebugData *pSortedList); ! void FillTableEntry(wxTreeItemId itemNode, const wxLuaDebugData *pSortedList); void GetDerivedAndTrackedItems(wxRemotelyScrolledTreeCtrl *treeControl, wxTreeItemId rootItem); --- 69,75 ---- void SizeWindow(int nWidth, int nHeight); ! void FillStackCombobox(const wxLuaDebugData& debugData); ! void FillStackEntry(int nEntry, const wxLuaDebugData& debugData); ! void FillTableEntry(wxTreeItemId itemNode, const wxLuaDebugData& debugData); void GetDerivedAndTrackedItems(wxRemotelyScrolledTreeCtrl *treeControl, wxTreeItemId rootItem); Index: wxldebug.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxldebug.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wxldebug.h 4 Sep 2006 18:07:55 -0000 1.20 --- wxldebug.h 7 Sep 2006 22:42:19 -0000 1.21 *************** *** 74,86 **** // ---------------------------------------------------------------------------- ! // wxLuaDebugData - a wxSortedArray of pointers to wxLuaDebugDataItem(s) ! // it has a destructor that deletes them. // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugData : public wxLuaDebugDataItemArray { public: wxLuaDebugData(); ! virtual ~wxLuaDebugData(); // fill this with the stack entries for the wxLuaState --- 74,92 ---- // ---------------------------------------------------------------------------- ! // wxLuaDebugData - a wxObject ref counted container for a wxLuaDebugDataItemArray ! // The Ref data is always expected to exist and the destructor deletes the array items ! // This is supposed to be a minimal class so all array operations are though the ! // member functions GetDataArray(). // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugData : public wxObject { public: wxLuaDebugData(); ! wxLuaDebugData(const wxLuaDebugData &debugData) { Ref(debugData); } ! ! // Get the data array ! wxLuaDebugDataItemArray& GetDataArray(); ! const wxLuaDebugDataItemArray& GetDataArray() const; // fill this with the stack entries for the wxLuaState *************** *** 103,108 **** static wxString GetUserDataInfo(const wxLuaState& wxlState, int index, bool full = true); ! wxLuaDebugData *Clone() const; static int SortFunction(wxLuaDebugDataItem *elem1, wxLuaDebugDataItem *elem2 ); }; --- 109,130 ---- static wxString GetUserDataInfo(const wxLuaState& wxlState, int index, bool full = true); ! // Make a full copy of the array and return it. ! wxLuaDebugData Copy() const; ! static int SortFunction(wxLuaDebugDataItem *elem1, wxLuaDebugDataItem *elem2 ); + + //------------------------------------------------------------------------- + // operators + bool operator == (const wxLuaDebugData& debugData) const + { return m_refData == debugData.m_refData; } + bool operator != (const wxLuaDebugData& debugData) const + { return m_refData != debugData.m_refData; } + + wxLuaDebugData& operator = (const wxLuaDebugData& debugData) + { + if ( (*this) != debugData ) + Ref(debugData); + return *this; + } }; *************** *** 117,124 **** virtual ~wxLuaInterface(); ! virtual wxLuaDebugData *EnumerateStack(); ! virtual wxLuaDebugData *EnumerateStackEntry(int nEntry); ! virtual wxLuaDebugData *EnumerateTable(int nRef, int nEntry, long data = 0); ! virtual wxLuaDebugData *GetGlobalData(); // allows for this to be subclassed for use with the wxLuaDebugServer --- 139,146 ---- virtual ~wxLuaInterface(); ! virtual wxLuaDebugData EnumerateStack(); ! virtual wxLuaDebugData EnumerateStackEntry(int nEntry); ! virtual wxLuaDebugData EnumerateTable(int nRef, int nEntry, long data = 0); ! virtual wxLuaDebugData GetGlobalData(); // allows for this to be subclassed for use with the wxLuaDebugServer |