|
MADNESS
version 0.9
|
Scoped array. More...
#include <scopedptr.h>
Public Types | |
| typedef ptrT | element_type |
| the pointer type More... | |
Public Member Functions | |
| ScopedArray (ptrT *p=NULL) | |
| Construct a scoped pointer. More... | |
| ~ScopedArray () | |
| Destructor. More... | |
| void | reset (ptrT *p=NULL) |
| Reset the current pointer. More... | |
| ptrT & | operator[] (std::size_t i) const |
| Array element accessor. More... | |
| ptrT * | get () const |
| Pointer accessor. More... | |
| operator bool () const | |
bool conversion operator More... | |
| bool | operator! () const |
| Not operator. More... | |
| void | swap (ScopedArray< ptrT > &other) |
| Swap the pointers. More... | |
Scoped array.
Holds a pointer to an array until it goes out of scope, then automatically deletes it. A scoped array pointer should be used to wrap pointers where the lifetime of the array pointer should be limited to a specific scope. The pointer cannot be copied. The pointer will be deleted with the delete operator.
| ptrT | The pointer type |
ptrT must be a complete type | typedef ptrT madness::ScopedArray< ptrT >::element_type |
the pointer type
|
inlineexplicit |
Construct a scoped pointer.
| p | The pointer to hold [default = NULL] |
| nothing |
|
inline |
Destructor.
Calls delete[] operator
|
inline |
Pointer accessor.
| nothing |
Referenced by madness::WorldAmInterface::free_managed_buffers(), SafeMPI::Request::Testany(), and SafeMPI::Request::Testsome().
|
inline |
bool conversion operator
| nothing |
|
inline |
Not operator.
| nothing |
|
inline |
Array element accessor.
| madness::MadnessException | If the pointer is NULL |
|
inline |
Reset the current pointer.
This will destroy the current pointer. If an new pointer is provided this pointer will be set to that value.
| p | The array pointer that will replace this pointer after deletion |
| madness::MadnessException | If p is the same as this pointer, except when this pointer is NULL. |
|
inline |
Swap the pointers.
| other | The pointer to swap with this pointer |
| nothing |
Referenced by madness::ScopedArray< counterT >::reset().
1.8.8