Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Referenced Class Reference

Base class from providing referencing counted objects. More...

Inheritance diagram for osg::Referenced:

Inheritance graph
[legend]
List of all members.

Public Methods

 Referenced ()
 Referenced (const Referenced &)
Referenced & operator= (Referenced &)
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it.

void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it.

void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it.

const int referenceCount () const
 return the number pointers currently referencing this object.


Protected Methods

virtual ~Referenced ()

Protected Attributes

int _refCount

Detailed Description

Base class from providing referencing counted objects.


Constructor & Destructor Documentation

osg::Referenced::Referenced   [inline]
 

osg::Referenced::Referenced const Referenced &    [inline]
 

virtual osg::Referenced::~Referenced   [protected, virtual]
 


Member Function Documentation

Referenced& osg::Referenced::operator= Referenced &    [inline]
 

void osg::Referenced::ref   const [inline]
 

increment the reference count by one, indicating that this object has another pointer which is referencing it.

const int osg::Referenced::referenceCount   const [inline]
 

return the number pointers currently referencing this object.

void osg::Referenced::unref   const [inline]
 

decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

void osg::Referenced::unref_nodelete   const [inline]
 

decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be resonsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.


Member Data Documentation

int osg::Referenced::_refCount [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:42 2002 for the Open Scene Graph by doxygen 1.2.16.