Laxkit  0.0.7.1
Public Member Functions | Public Attributes | Protected Attributes
Laxkit::RefCounted Class Reference

A minimal refcounted object. More...

List of all members.

Public Member Functions

virtual ~RefCounted ()
 Empty virtual destructor.
virtual int inc_count ()
 Increment the data's count by 1. Returns count.
virtual int dec_count ()
 Decrement the count of the data, deleting if count is less than or equal to 0.
virtual int the_count ()

Public Attributes

int suppress_debug

Protected Attributes

int _count
 The reference count of the object.

Detailed Description

A minimal refcounted object.

Provides inc_count() and dec_count() for reference counting. Objects are created with a count of 1.


Member Function Documentation

int Laxkit::RefCounted::dec_count ( )
virtual

Decrement the count of the data, deleting if count is less than or equal to 0.

Returns the count. If 0 is returned, the item is gone, and should not be accessed any more.


Member Data Documentation

int Laxkit::RefCounted::_count
protected

The reference count of the object.

Controlled with inc_count() and dec_count(). When the count is less or equal to 0, then object has 'delete this' called. See dec_count() for more.


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:53:00, Laxkit