yat  0.14.5pre
Public Member Functions | List of all members
theplu::yat::utility::Deleter Class Reference

Functor that deletes an object. More...

#include <yat/utility/Deleter.h>

Public Member Functions

 Deleter (bool active=true)
 constructor More...
 
bool active (void) const
 
template<typename T >
void operator() (T *ptr) const
 

Detailed Description

Functor that deletes an object.

The class is typically used as second argument to a boost::shared_ptr, which enables to decide at runtime whether the shared_ptr should own the pointee, i.e., should the pointee be destructed at destruction of last shared_ptr pointing to the pointee.

Since
New in yat 0.10

Constructor & Destructor Documentation

theplu::yat::utility::Deleter::Deleter ( bool  active = true)

constructor

Parameters
activedecides whether functor will delete object or not. See operator().

Member Function Documentation

bool theplu::yat::utility::Deleter::active ( void  ) const
Returns
true if class is activated.
template<typename T >
void theplu::yat::utility::Deleter::operator() ( T *  ptr) const
inline

Delete ptr if active() otherwise do nothing


The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5