![]() |
Allium
0.1.0
|
PETSc wrapper object for memory management. More...
#include <petsc_object_ptr.hpp>
Public Member Functions | |
| PetscObjectPtr (const PetscObjectPtr &other) | |
| PetscObjectPtr (PetscObjectPtr &&other) | |
| PetscObjectPtr (T new_value, bool adopt) | |
| operator T () const | |
| PetscObjectPtr & | operator= (const PetscObjectPtr &other) |
| void | release () |
| T | abandon () |
| void | set (T new_value, bool adopt) |
| T * | writable_ptr () |
| T | get () const |
Protected Attributes | |
| T | value |
Friends | |
| void | swap (PetscObjectPtr< T > &a, PetscObjectPtr< T > &b) |
PETSc wrapper object for memory management.
Takes care of increasing and decreasing reference counts.
|
inline |
Gives up the ownership of value without decreasing the reference count. Returns value.
|
inline |
Decrease the reference count of the PETSc object by one and set value to nullptr.
|
inline |
A pointer to set the value of the PetscObjectPtr. This releases the object and returns a pointer that can be used to set a new value. The pointer might not be used or set to null. In case a new values is provided, PetscObjectPtr adopts the referenced object, i.e., it will decrease its reference count when going out of scope.