#include <MEDMEM_PointerOf.hxx>

Public Member Functions | |
| PointerOf () | |
| ~PointerOf () | |
| PointerOf (const int &size) | |
| PointerOf (const T *pointer) | |
| PointerOf (const int &size, const T *pointer) | |
| PointerOf (const PointerOf< T > &pointerOf) | |
| operator T * () | |
| PointerOf( const int &size, const PointerOf<T> & pointerOf ) ;. | |
| operator const T * () const | |
| void | set (const int &size) |
| void | set (const T *pointer) |
| void | set (const int &size, const T *pointer) |
| void | setShallowAndOwnership (const T *pointer) |
| PointerOf< T > & | operator= (const PointerOf< T > &pointer) |
Protected Attributes | |
| T * | _pointer |
| bool | _done |
| MEDMEM.PointerOf< T >::PointerOf | ( | ) |
Creates a null T* pointer and sets the boolean (for desallocation) to false.
| MEDMEM.PointerOf< T >::~PointerOf | ( | ) |
The destuctor desallocates memory if necessary (that is if the attribute _done equals true).
The attribute _pointer is nullified
References MESSAGE_MED.
| MEDMEM.PointerOf< T >::PointerOf | ( | const int & | size | ) |
Duplicate array of size size pointed in pointerOf.
If size < 0, creates a null "T*" pointer
Else allocates memory and sets desallocation boolean to true.
Memory will be desallocated when erasing this PointerOf
References test_NonCoincidentDEC.size.
| MEDMEM.PointerOf< T >::PointerOf | ( | const T * | pointer | ) |
Creates a standard pointer to the memory zone pointed by T*.
T* owner is in charged of memory desallocation.
Memory will not be released when erasing this PointerOf
| MEDMEM.PointerOf< T >::PointerOf | ( | const int & | size, |
| const T * | pointer | ||
| ) |
If size < 0, return an exception
Else duplicate array and sets desallocation boolean to true.
Memory will be desallocated when erasing this PointerOf
References test_NonCoincidentDEC.size.
| MEDMEM.PointerOf< T >::PointerOf | ( | const PointerOf< T > & | pointerOf | ) |
Creates a standard T* pointer to the pointed memory.
The boolean for desallocation is setted to false.
Be aware :
References BEGIN_OF_MED, END_OF_MED, and MESSAGE_MED.
| MEDMEM.PointerOf< T >::operator T * | ( | ) |
PointerOf( const int &size, const PointerOf<T> & pointerOf ) ;.
Returns _pointer.
| MEDMEM.PointerOf< T >::operator const T * | ( | ) | const |
Returns _pointer.
| void MEDMEM.PointerOf< T >::set | ( | const int & | size | ) |
If necessary, released memory holded by PointerOf
. Else allocates memory and sets desallocation boolean to true.
Can be used in order to "nullify" an existing PointerOf
Memory will be desallocated when erasing this PointerOf
References test_NonCoincidentDEC.size.
| void MEDMEM.PointerOf< T >::set | ( | const T * | pointer | ) |
If necessary, released memory holded by PointerOf
. Then, sets _pointer to the memory zone pointed by T*.
T* owner is in charged of memory desallocation.
memory will not be released when erasing this PointerOf
References MESSAGE_MED, and SCRUTE_MED.
| void MEDMEM.PointerOf< T >::set | ( | const int & | size, |
| const T * | pointer | ||
| ) |
If necessary, released memory holded by PointerOf
. If size < 0, return an exception
. Else allocates memory and sets desallocation boolean to true.
Can be used in order to "nullify" an existing PointerOf
Memory will be desallocated when erasing this PointerOf
References test_NonCoincidentDEC.size.
| void MEDMEM.PointerOf< T >::setShallowAndOwnership | ( | const T * | pointer | ) |
| PointerOf< T > & MEDMEM.PointerOf< T >::operator= | ( | const PointerOf< T > & | pointer | ) |
Creates a standard pointer (T*) to the pointed memory.
The boolean for desallocation is setted to false.
Be aware :
References MEDMEM.PointerOf< T >._pointer, BEGIN_OF_MED, and END_OF_MED.
T* MEDMEM.PointerOf< T >._pointer [protected] |
pointer to the pointed memory
bool MEDMEM.PointerOf< T >._done [protected] |
boolean setted to true if memory has to be desallocated