00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: Group definition for GB_Breakpoint types (C++) 00015 * 00016 * COMMENTS: 00017 * 00018 */ 00019 00020 #ifndef __GB_BreakpointGroup_h__ 00021 #define __GB_BreakpointGroup_h__ 00022 00023 #include "GB_API.h" 00024 #include <UT/UT_LinkList.h> 00025 #include <UT/UT_String.h> 00026 #include "GB_BaseGroup.h" 00027 #include "GB_Breakpoint.h" 00028 #include "GB_GroupList.h" 00029 00030 00031 class GB_API GB_BreakpointGroup : public GB_BaseGroup 00032 { 00033 public: 00034 GB_BreakpointGroup(const GB_Detail &gdp, const char *name, int hidden = 1, 00035 unsigned short type = GBBREAKPOINTGROUP); 00036 ~GB_BreakpointGroup(); 00037 00038 // Find out if we contain mixed elements. 00039 int isMixed(void) const; 00040 00041 GB_Breakpoint *find(const GB_Breakpoint *it) const; 00042 00043 int contains(const GB_Breakpoint *it) const; 00044 int contains(const GB_Breakpoint &it) const 00045 { return contains(&it); } 00046 00047 // Adds return 1 if successful and 0 otherwise 00048 int add(GB_Breakpoint *it); 00049 int add(GB_Breakpoint &it) 00050 { return add(&it); } 00051 00052 int toggle(GB_Breakpoint *it); 00053 int toggle(GB_Breakpoint &it) 00054 { return toggle(&it); } 00055 00056 // Removes the breakpoint and deletes the data if deletedata is set 00057 int remove(GB_Breakpoint *it, bool deletedata=true); 00058 int remove(GB_Breakpoint &it) 00059 { return remove(&it); } 00060 int remove(unsigned int num) 00061 { 00062 return (int) 00063 remove((GB_Breakpoint *)myBreakpointList.find((int)num)); 00064 } 00065 00066 00067 00068 UT_LinkList &list() { return myBreakpointList; } 00069 const UT_LinkList &list() const { return myBreakpointList; } 00070 00071 00072 // Both methods return the number of elements in the group. The first one 00073 // looks only at the non-mixed elements, while the second looks at the 00074 // mixed ones _as well_ (not only at he mixed ones). 00075 virtual unsigned entries() const 00076 { return myBreakpointList.length() - myNumSecondary; } 00077 00078 unsigned entriesMix() const 00079 { return (unsigned)myBreakpointList.length(); } 00080 00081 virtual int isEmpty() const 00082 { return myBreakpointList.length() <= myNumSecondary; } 00083 00084 int isEmptyMix() const 00085 { return myBreakpointList.isEmpty(); } 00086 00087 virtual void clearEntries(void); 00088 00089 virtual int save(ostream &os, int binary) const; 00090 virtual bool load(UT_IStream &is); 00091 00092 private: 00093 00094 UT_LinkList myBreakpointList; 00095 const GB_Detail &myGdp; 00096 unsigned myNumSecondary; // number of secondary 00097 // breakpoints 00098 }; 00099 00100 #endif
1.5.9