CpgUsable

CpgUsable — Interface for counting the uses of an object

Synopsis

struct              CpgUsableInterface;
guint               cpg_usable_use_count                (CpgUsable *self);
void                cpg_usable_use                      (CpgUsable *self);
gboolean            cpg_usable_unuse                    (CpgUsable *self);

Description

This interface can be implemented when an object provides a use count.

Details

struct CpgUsableInterface

struct CpgUsableInterface {
	GTypeInterface parent;

	guint    (*use_count) (CpgUsable *self);
	void     (*use)       (CpgUsable *self);
	gboolean (*unuse)     (CpgUsable *self);
};


cpg_usable_use_count ()

guint               cpg_usable_use_count                (CpgUsable *self);

Get the use count of the usable.

self :

A CpgUsable

Returns :

The use count

cpg_usable_use ()

void                cpg_usable_use                      (CpgUsable *self);

Increase the use count.

self :

A CpgUsable

cpg_usable_unuse ()

gboolean            cpg_usable_unuse                    (CpgUsable *self);

Decrease the use count.

self :

A CpgUsable

Returns :

TRUE if the use count dropped to 0, FALSE otherwise