LibMusicXML 3.22
smartable Class Reference

the base class for smart pointers implementation More...

#include <smartpointer.h>

Inheritance diagram for smartable:
iterator< xmlelement > treePtr< T > ctree< xmlelement > ctree< MusicXML2::xmlelement > TXMLFile ctree< T > guidoelement guidoparam smartlist< T, L > xmlattribute

Public Member Functions

unsigned refs () const
 gives the reference count of the object
void addReference ()
 addReference increments the ref count and checks for refCount overflow
void removeReference ()
 removeReference delete the object when refCount is zero

Protected Member Functions

 smartable (const smartable &)
virtual ~smartable ()
 destructor checks for non-zero refCount
smartableoperator= (const smartable &)

Detailed Description

Any object that want to support smart pointers should inherit from the smartable class which provides reference counting and automatic delete when the reference count drops to zero.