cu/weakptr.h: Weak Pointers
[Utilities]

Functions

cu_bool_t cu_weakptr_is_null (cu_hidden_ptr_t *link)
void * cu_weakptr_get (cu_hidden_ptr_t *link)
void cu_weakptr_init_null (cu_hidden_ptr_t *link)
void cu_weakptr_init (cu_hidden_ptr_t *link, void *ptr)
void cu_weakptr_deinit (cu_hidden_ptr_t *link)
void cu_weakptr_assign_null (cu_hidden_ptr_t *link)
void cu_weakptr_assign (cu_hidden_ptr_t *link, void *obj)

Function Documentation

void cu_weakptr_assign ( cu_hidden_ptr_t link,
void *  obj 
)

Assign a non-NULL value to link, re-registering the disappearing link.

Precondition:
ptr != NULL
void cu_weakptr_assign_null ( cu_hidden_ptr_t link  ) 

Assign NULL to link, releasing any previous disappearing link registration.

void cu_weakptr_deinit ( cu_hidden_ptr_t link  ) 

Release any disappearing link registration for link.

void* cu_weakptr_get ( cu_hidden_ptr_t link  ) 

Safely return the value of the weak pointer link, or NULL if the object it pointed to was recycled.

void cu_weakptr_init ( cu_hidden_ptr_t link,
void *  ptr 
)

Construct link as a weak pointer to ptr. If ptr gets collected, the link will be cleared, as manifested by a NULL return from cu_weakptr_get(link).

Precondition:
ptr != NULL
void cu_weakptr_init_null ( cu_hidden_ptr_t link  ) 

Construct link as a weak pointer with a NULL value.

cu_bool_t cu_weakptr_is_null ( cu_hidden_ptr_t link  ) 

True iff link holds the NULL pointer.

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