|
Open PaperOpt
|
#include <utilities.h>
Public Member Functions | |
| AutoDelete () | |
| AutoDelete (C *p) | |
| ~AutoDelete () | |
| C * | operator-> () const |
| C & | operator* () const |
| C * | Ptr () const |
| operator C * () const | |
| void | clear () |
| void | set (C *p) |
| void | operator= (C *p) |
| C * | detatch () |
this file contains all the solitary functions used in p3d and the ancillary class Index of classes in this file: Update
1. template <class c>=""> class AutoDelete memory management class 2. template <class c>=""> class AutoDeleteV memory management class 3. class SimpleDist Definition template <int numbins>=""> SimpleDist 4. class SubdivPatch 5. class SubdivEnv 6. class fiberdata 7. class TreeNode 8. class FiberSample
This class can be used to simplify memory deallocation. It's only simple wrapper for a pointer and its only function is to destroy the referenced object when the pointer is itself destroyed the difference between class AutoDelete and AutoDeleteV is that class AutoDeleteV is used to manage the memory for the array.
| AutoDelete< C >::AutoDelete | ( | ) | [inline] |
default constructor
| AutoDelete< C >::AutoDelete | ( | C * | p | ) | [inline] |
constructor allocate memory from the existing pointer
| p | the pointer to the given memory space |
| AutoDelete< C >::~AutoDelete | ( | ) | [inline] |
| void AutoDelete< C >::clear | ( | ) | [inline] |
set the ptr=0

| C* AutoDelete< C >::detatch | ( | ) | [inline] |
explicitly invoke this function to release the memory when you use this class to allocate memory to the variables

| AutoDelete< C >::operator C * | ( | ) | const [inline] |
overload the pointer operator "*" it returns an address of the memory space
| C& AutoDelete< C >::operator* | ( | ) | const [inline] |
overload the pointer operator "*" it returns the element that the ptr points to
| C* AutoDelete< C >::operator-> | ( | ) | const [inline] |
overload pointer operator "->" make the '->' has the same function as the normal pointer to the class
| void AutoDelete< C >::operator= | ( | C * | p | ) | [inline] |
overload the operator "="
| p | the pointer to the given memory space |
| C* AutoDelete< C >::Ptr | ( | ) | const [inline] |
return the private data member --ptr which is used to point the allocated the memory space.
| void AutoDelete< C >::set | ( | C * | p | ) | [inline] |
set the ptr to the given pointer
| p | the pointer to the given memory space |