Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/vector_memory.h>
Public Member Functions | |
virtual VectorType * | alloc () override |
virtual void | free (const VectorType *const v) override |
virtual void | free (const ::Vector< double > *const)=0 |
Static Public Member Functions | |
static ::ExceptionBase & | ExcNotAllocatedHere () |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
void | subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
void | unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const |
unsigned int | n_subscriptions () const |
template<typename StreamType > | |
void | list_subscribers (StreamType &stream) const |
void | list_subscribers () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
static std::mutex | mutex |
void | check_no_subscribers () const noexcept |
Simple memory management. See the documentation of the base class for a description of its purpose.
This class allocates and deletes vectors as needed from the global heap, i.e. performs no specially adapted actions for memory management.
Definition at line 236 of file vector_memory.h.
|
pure virtualinherited |
Return a vector and indicate that it is not going to be used any further by the place that called alloc() to get a pointer to it.
new
and delete
explicitly in code invites bugs where memory is leaked (either because the corresponding delete
is forgotten altogether, or because of exception safety issues), using the alloc() and free() functions explicitly invites writing code that accidentally leaks memory. You should consider using the VectorMemory::Pointer class instead, which provides the same kind of service that std::unique
provides for arbitrary memory allocated on the heap.
|
staticinherited |
Vector was not allocated from this memory pool.