Lines Matching defs:Set

46 // Set class is an abstract class, and cannot be constructed.  Instead,
73 // Clear: Remove all the elements of a Set
74 // Insert: Insert an element into a Set; duplicates are ignored
75 // Delete: Removes an element from a Set
76 // Member: Tests for membership in a Set
77 // Size: Returns the number of members of a Set
78 // Copy: Copy or assign one Set to another
86 // Forall: Iterate over the elements of a Set. Operations that modify
89 // Complement: Only supported in the Co-Set variations. It adds a small
90 // constant-time test to every Set operation.
94 // operations on the basic "Set" object you will pay a virtual function call
96 // generic Set means you can change underlying implementations by just
101 // void foo(Set vs1, Set vs2) { vs1 |= vs2; }
116 //------------------------------Set--------------------------------------------
117 class Set : public ResourceObj {
121 // DO NOT CONSTRUCT A Set. THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
122 Set(Arena *arena) : _set_arena(arena) {};
125 // DO NOT CONSTRUCT A Set. THIS IS AN ABSTRACT CLASS, FOR INHERITENCE ONLY
126 Set(const Set &) {};
128 // Set assignment; deep-copy guts
129 virtual Set &operator =(const Set &s)=0;
130 virtual Set &clone(void) const=0;
133 virtual ~Set() {};
136 virtual Set &operator <<=(uint elem)=0;
137 // virtual Set operator << (uint elem);
140 virtual Set &operator >>=(uint elem)=0;
141 // virtual Set operator >> (uint elem);
147 virtual Set &operator &=(const Set &s)=0;
148 // virtual Set operator & (const Set &s) const;
151 virtual Set &operator |=(const Set &s)=0;
152 // virtual Set operator | (const Set &s) const;
155 virtual Set &operator -=(const Set &s)=0;
156 // virtual Set operator - (const Set &s) const;
159 virtual int operator ==(const Set &s) const=0;
160 int operator !=(const Set &s) const { return !(*this == s); }
161 virtual int disjoint(const Set &s) const=0;
164 virtual int operator < (const Set &s) const=0;
165 int operator > (const Set &s) const { return s < *this; }
168 virtual int operator <=(const Set &s) const=0;
169 int operator >=(const Set &s) const { return s <= *this; }
171 // Return any member of the Set. Undefined if the Set is empty.
174 // Clear all the elements in the Set
177 // Return the number of members in the Set
180 // If an iterator follows a "Sort()" without any Set-modifying operations
188 // Print the Set on "stdout". Can be conveniently called in the debugger
191 // Parse text from the string into the Set. Return length parsed.
194 // Convert a generic Set to a specific Set
217 typedef Set&((*Set_Constructor)(Arena *arena));
218 extern Set &ListSet_Construct(Arena *arena);
219 extern Set &VectorSet_Construct(Arena *arena);
220 extern Set &SparseSet_Construct(Arena *arena);
244 SetI( const Set *s ) { impl = s->iterate(elem); }
246 void reset( const Set *s ) { delete impl; impl = s->iterate(elem); }