Chaste  Release::3.4
null_deleter Struct Reference
+ Collaboration diagram for null_deleter:

Public Member Functions

void operator() (void const *) const
 
void operator() (void const *) const
 

Detailed Description

null_deleter means "doesn't delete" rather than "deletes nulls".

Sometimes it is desirable to create a shared_ptr to an already existing object, so that the shared_ptr does not attempt to destroy the object when there are no more references left. As an example, the factory function:

shared_ptr<X> createX(); in certain situations may need to return a pointer to a statically allocated X instance.

The solution is to use a custom deleter that does nothing:

This null deleter is for the next method, SendCellsToNeighbourProcesses so we can make a shared_ptr copy of mCellsToSendx without it actually being deleted when the pointer goes out of scope. We need a shared pointer to send it because ObjectCommunicator only sends/recvs shared pointers to avoid memory management problems.

Definition at line 53 of file Cell.cpp.

Member Function Documentation

void null_deleter::operator() ( void const *  ) const
inline

Does not delete

Definition at line 56 of file Cell.cpp.

void null_deleter::operator() ( void const *  ) const
inline

The delete operation that does nothing.

Definition at line 748 of file NodeBasedCellPopulation.cpp.


The documentation for this struct was generated from the following files: