glv::SmartPointer Class Reference

Smart pointer functionality to avoid deleting references. More...

#include <glv_util.h>

Inheritance diagram for glv::SmartPointer:

glv::Style

List of all members.

Public Member Functions

 SmartPointer (bool del=true)
bool smartDelete ()
 Deletes object only if it is deletable, i.e. not a reference.
void deletable (bool v)
 Set whether the object can be deleted.
bool deletable ()
 Returns whether the object can be deleted.


Detailed Description

Smart pointer functionality to avoid deleting references.

When a class contains pointers to other objects, sometimes it is not clear if it is responsible for freeing the memory associated with those objects.


Constructor & Destructor Documentation

glv::SmartPointer::SmartPointer ( bool  del = true  )  [inline]

Parameters:
[in] del whether the object is deleted with smartDelete()


Member Function Documentation

bool glv::SmartPointer::smartDelete (  )  [inline]

Deletes object only if it is deletable, i.e. not a reference.

Returns true if the object destructor was called, false otherwise.


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

Generated on Thu Aug 12 23:55:16 2010 for GLV by  doxygen 1.5.5