cucon/pset.h: Poiter-Keyed Sets
[Associative Containers (trees, maps, sets)]

Data Structures

struct  cucon_pset

Defines

#define cucon_pset_cct   cucon_pset_init
#define cucon_pset_cct_copy   cucon_pset_init_copy

Functions

void cucon_pset_init (cucon_pset_t set)
cucon_pset_t cucon_pset_new (void)
void cucon_pset_init_copy (cucon_pset_t set, cucon_pset_t src_set)
cucon_pset_t cucon_pset_new_copy (cucon_pset_t src_set)
void cucon_pset_swap (cucon_pset_t set0, cucon_pset_t set1)
cu_bool_t cucon_pset_eq (cucon_pset_t set0, cucon_pset_t set1)
cu_hash_t cucon_pset_hash (cucon_pset_t set)
size_t cucon_pset_size (cucon_pset_t set)
cu_bool_t cucon_pset_is_empty (cucon_pset_t set)
cu_bool_t cucon_pset_insert (cucon_pset_t set, void *key)
cu_bool_t cucon_pset_erase (cucon_pset_t set, void *key)
cu_bool_t cucon_pset_erase_keep_cap (cucon_pset_t set, void *key)
void cucon_pset_update_cap (cucon_pset_t set)
void * cucon_pset_pop_any (cucon_pset_t set)
cu_bool_t cucon_pset_find (cucon_pset_t set, void *key)
void cucon_pset_iter (cucon_pset_t set, cu_clop(cb, void, void const *key))
cu_bool_t cucon_pset_conj (cucon_pset_t set, cu_clop(cb, cu_bool_t, void const *key))
void cucon_pset_assign_isecn_union (cucon_pset_t set0, cucon_pset_t set1)
void cucon_pset_move_isecn (cucon_pset_t dst, cucon_pset_t src0, cucon_pset_t src1)
void cucon_pset_assign_isecn (cucon_pset_t dst, cucon_pset_t src)
void cucon_pset_assign_union (cucon_pset_t dst, cucon_pset_t src)

Detailed Description

See also:
cucon/pmap.h: Pointer-Keyed Hash Map

Define Documentation

#define cucon_pset_cct   cucon_pset_init
#define cucon_pset_cct_copy   cucon_pset_init_copy

Function Documentation

void cucon_pset_assign_isecn ( cucon_pset_t  dst,
cucon_pset_t  src 
)

Assigns dst := dstsrc.

void cucon_pset_assign_isecn_union ( cucon_pset_t  set0,
cucon_pset_t  set1 
)

Assign set0 := set0set1 and set1 := set0set1 by moving the elements set0set1 from set0 to set1.

void cucon_pset_assign_union ( cucon_pset_t  dst,
cucon_pset_t  src 
)

Assigns dst := dstsrc.

cu_bool_t cucon_pset_conj ( cucon_pset_t  set,
cu_clop(cb, cu_bool_t, void const *key)   
)

Sequantially conjunct cb over elements of set.

cu_bool_t cucon_pset_eq ( cucon_pset_t  set0,
cucon_pset_t  set1 
)

True iff set0 and set1 contain the same elements.

cu_bool_t cucon_pset_erase ( cucon_pset_t  set,
void *  key 
)

If keyset, erase it and return true, else return false.

cu_bool_t cucon_pset_erase_keep_cap ( cucon_pset_t  set,
void *  key 
)

Same as cucon_pset_erase, but don't resize internal vector. This can be faster if you need to erase many values in a row, and when done, call cucon_pset_update_cap.

cu_bool_t cucon_pset_find ( cucon_pset_t  set,
void *  key 
)

True iff keyset.

cu_hash_t cucon_pset_hash ( cucon_pset_t  set  ) 

Returns a hash of the elements of set.

void cucon_pset_init ( cucon_pset_t  set  ) 

Constructs set as an empty set.

void cucon_pset_init_copy ( cucon_pset_t  set,
cucon_pset_t  src_set 
)

Constructs set as a copy of src_set.

cu_bool_t cucon_pset_insert ( cucon_pset_t  set,
void *  key 
)

If keyset, insert it and return true, else return false.

cu_bool_t cucon_pset_is_empty ( cucon_pset_t  set  ) 

True iff set is empty.

void cucon_pset_iter ( cucon_pset_t  set,
cu_clop(cb, void, void const *key)   
)

Call cb(k) for each kset.

void cucon_pset_move_isecn ( cucon_pset_t  dst,
cucon_pset_t  src0,
cucon_pset_t  src1 
)

Assigns dst := src0src1; src0 := src0src1; src1 := src1 ∖ src0.

cucon_pset_t cucon_pset_new ( void   ) 

Returns an empty set.

cucon_pset_t cucon_pset_new_copy ( cucon_pset_t  src_set  ) 

Returns a copy of src_set.

void* cucon_pset_pop_any ( cucon_pset_t  set  ) 

Pop any element of set and return it. A random number generator is used to select a position in the hash array in order to preserve the average case structure of set.

size_t cucon_pset_size ( cucon_pset_t  set  ) 

The number of elements in set.

void cucon_pset_swap ( cucon_pset_t  set0,
cucon_pset_t  set1 
)

Swap the contents of set0 and set1.

void cucon_pset_update_cap ( cucon_pset_t  set  ) 

Call this after using cucon_pset_erase_keep_cap.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.