Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Object Class Reference

Reference counting base class. More...

#include <xfc/object.hh>

Inheritance diagram for Xfc::Object:

Xfc::Trackable Xfc::G::AsyncQueue Xfc::G::Boxed Xfc::G::Completion Xfc::G::Condition Xfc::G::Date Xfc::G::KeyFile Xfc::G::MarkupParseContext Xfc::G::Module Xfc::G::Mutex Xfc::G::OptionContext Xfc::G::OptionGroup Xfc::G::PatternSpec Xfc::G::Rand Xfc::G::Scanner Xfc::G::ThreadPool Xfc::G::Timer Xfc::Gdk::PixbufFormat Xfc::Gdk::Region Xfc::Gtk::TargetList Xfc::Pango::Attribute Xfc::Pango::AttrIterator Xfc::Pango::Coverage Xfc::Pango::Item Xfc::Pango::LayoutLine List of all members.

Public Member Functions

Protected Member Functions


Detailed Description

Reference counting base class.

Object is a base class that implements reference counting. Derived from Trackable, it adds an integer reference counter so that dynamic objects can have their memory allocation handled by the XFC smart pointer: Pointer<>. This keeps the memory management in XFC consistent across all classes. If you derive a class from Xfc::Object and allocate it on the heap, you free the memory and destroy the object by calling unref(), not delete.

Note if you declare a class that derives from Xfc::Object on the stack you don't need to call unref(). It's not an error to do so though because nothing will happen.


Member Function Documentation

virtual void Xfc::Object::unref  )  [virtual]
 

Decrease an object's reference count by one.

When the reference count becomes zero delete is called. Remember, with Object you must call unref() on dynmaically allocated objects, not delete.

Reimplemented from Xfc::Trackable.

Reimplemented in Xfc::G::AsyncQueue.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3