Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Classes | Public Member Functions | Private Member Functions | Private Attributes

Inkscape::GC::Anchored Class Reference

#include <gc-anchored.h>

Inheritance diagram for Inkscape::GC::Anchored:
Inheritance graph
Collaboration diagram for Inkscape::GC::Anchored:
Collaboration graph

List of all members.


struct  Anchor

Public Member Functions

unsigned _anchored_refcount () const
void anchor () const
void release () const

Private Member Functions

void _free_anchor (Anchor *anchor) const
Anchor_new_anchor () const
 Anchored (Anchored const &)
void operator= (Anchored const &)

Private Attributes


Detailed Description

A base class for anchored objects.

Objects are managed by our mark-and-sweep collector, but are anchored against garbage collection so long as their reference count is nonzero.

Object and member destructors will not be called on destruction unless a subclass also inherits from Inkscape::GC::Finalized.

New instances of anchored objects should be created using the C++ new operator. Under normal circumstances they should not be created on the stack.

A newly created anchored object begins with a refcount of one, and will not be collected unless the refcount is zero.

NOTE: If you create an object yourself, it is already anchored for you. You do not need to anchor it a second time.

Note that a cycle involving an anchored object (with nonzero refcount) cannot be collected. To avoid this, don't increment refcounts for pointers between two GC-managed objects.

See also:

Definition at line 50 of file gc-anchored.h.

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

Generated by  Doxygen 1.6.0   Back to index