Reference documentation for deal.II version 8.5.1
|
#include <deal.II/lac/vector_memory.h>
Public Member Functions | |
Pointer (VectorMemory< VectorType > &mem) | |
~Pointer () | |
operator VectorType * () const | |
VectorType & | operator* () const |
VectorType * | operator-> () const |
Private Attributes | |
SmartPointer< VectorMemory< VectorType >, Pointer > | pool |
VectorType * | v |
A class that looks like a pointer for all practical purposes and that upon construction time allocates a vector from a VectorMemory object (or an object of a derived class) that is passed to the constructor. The destructor then automatically returns the vector's ownership to the same VectorMemory object.
Pointers of this type are therefore safe in the sense that they automatically call VectorMemory::free() when they are destroyed, whether that happens at the end of a code block or because local variables are destroyed during exception unwinding. These kinds of object thus relieve the user from using vector management functions explicitly.
Definition at line 123 of file vector_memory.h.
VectorMemory< VectorType >::Pointer::Pointer | ( | VectorMemory< VectorType > & | mem | ) |
Constructor, automatically allocating a vector from mem
.
VectorMemory< VectorType >::Pointer::~Pointer | ( | ) |
Destructor, automatically releasing the vector from the memory pool.
VectorMemory< VectorType >::Pointer::operator VectorType * | ( | ) | const |
Conversion to regular pointer.
VectorType& VectorMemory< VectorType >::Pointer::operator* | ( | ) | const |
Dereferencing operator.
VectorType* VectorMemory< VectorType >::Pointer::operator-> | ( | ) | const |
Dereferencing operator.
|
private |
The memory pool used.
Definition at line 154 of file vector_memory.h.
|
private |
The pointer to the vector.
Definition at line 159 of file vector_memory.h.