![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <cpg-network/cpg-ref-counted.h> CpgRefCounted; void cpg_ref_counted_init (gpointer ref_counted, GDestroyNotify destroy_func); gpointer cpg_ref_counted_ref (gpointer ref_counted); void cpg_ref_counted_unref (gpointer ref_counted);
CpgRefCounted is a very lightweight implementation of a reference counted object, similar to GObject but without all the additional functionality.
void cpg_ref_counted_init (gpointer ref_counted, GDestroyNotify destroy_func);
Use this after a new ref counted object has been constructed. This sets the callback to be used when the ref count decreases to 0. The function sets the initial ref count to 1
|
a CpgRefCounted |
|
callback to destroy the ref counted object |
gpointer cpg_ref_counted_ref (gpointer ref_counted);
Increase the ref count on ref_counted
.
|
a CpgRefCounted |
Returns : |
ref_counted
|
void cpg_ref_counted_unref (gpointer ref_counted);
Decrease the ref count on ref_counted
.
|
a CpgRefCounted |