Home | History | Annotate | Download | only in include

Lines Matching refs:OSet

3 /*--- OSet: a fast data structure with no dups.    pub_tool_oset.h ---*/
37 // duplicate to an OSet.
50 // (eg. in an OSet of integers, each integer serves both as an element and
58 // element. This fast comparison is suitable for an OSet containing
61 // Each OSet interface also has an iterator, which makes it simple to
65 // Note that once you insert an element into an OSet, if you modify any part
73 typedef struct _OSet OSet;
87 // * Create: allocates and initialises the OSet. Arguments:
89 // OSet and all its nodes.
102 extern OSet* VG_(OSetWord_Create) ( OSetAlloc_t alloc, HChar* cc,
104 extern void VG_(OSetWord_Destroy) ( OSet* os );
124 // * ResetIter: Each OSet has an iterator. This resets it to point to the
125 // first element in the OSet.
127 // * Next: Copies the next value according to the OSet's iterator into &val,
135 // VG_(OSetWord_ResetIter)(oset);
136 // while ( VG_(OSetWord_Next)(oset, &val) ) {
141 // removed from the OSet, to avoid possible mayhem caused by the iterator
142 // getting out of sync with the OSet's contents. "Cleared" means that
146 extern Word VG_(OSetWord_Size) ( OSet* os );
147 extern void VG_(OSetWord_Insert) ( OSet* os, UWord val );
148 extern Bool VG_(OSetWord_Contains) ( OSet* os, UWord val );
149 extern Bool VG_(OSetWord_Remove) ( OSet* os, UWord val );
150 extern void VG_(OSetWord_ResetIter) ( OSet* os );
151 extern Bool VG_(OSetWord_Next) ( OSet* os, /*OUT*/UWord* val );
155 /*--- Creating and destroying OSets and OSet members (Gen) ---*/
158 // * Create: allocates and initialises the OSet. Arguments:
161 // if the OSet should use fast comparisons.
162 // - alloc The allocation function used for allocating the OSet itself;
176 // * AllocNode: Allocate and zero memory for a node to go into the OSet.
178 // node which is big enough for both an element and the OSet metadata.
179 // Not all elements in one OSet have to be the same size.
188 extern OSet* VG_(OSetGen_Create) ( PtrdiffT keyOff, OSetCmp_t cmp,
191 extern void VG_(OSetGen_Destroy) ( OSet* os );
192 extern void* VG_(OSetGen_AllocNode) ( OSet* os, SizeT elemSize );
193 extern void VG_(OSetGen_FreeNode) ( OSet* os, void* elem );
210 // * Contains: Determines if any element in the OSet matches the key.
216 // which overrides the OSet's normal one.
221 // * ResetIter: Each OSet has an iterator. This resets it to point to the
222 // first element in the OSet.
229 // * Next: Returns a pointer to the element pointed to by the OSet's
231 // in order. Or, returns NULL if the iterator has reached the OSet's end.
235 // VG_(OSetGen_ResetIter)(oset);
236 // while ( (elem = VG_(OSetGen_Next)(oset)) ) {
241 // removed from the OSet, to avoid possible mayhem caused by the iterator
242 // getting out of sync with the OSet's contents. "Cleared" means that
246 extern Word VG_(OSetGen_Size) ( const OSet* os );
247 extern void VG_(OSetGen_Insert) ( OSet* os, void* elem );
248 extern Bool VG_(OSetGen_Contains) ( const OSet* os, const void* key );
249 extern void* VG_(OSetGen_Lookup) ( const OSet* os, const void* key );
250 extern void* VG_(OSetGen_LookupWithCmp)( OSet* os,
252 extern void* VG_(OSetGen_Remove) ( OSet* os, const void* key );
253 extern void VG_(OSetGen_ResetIter) ( OSet* os );
254 extern void VG_(OSetGen_ResetIterAt) ( OSet* os, const void* key );
255 extern void* VG_(OSetGen_Next) ( OSet* os );