yat  0.18pre
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.

New in yat 0.10

Constructor & Destructor Documentation

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


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

Member Function Documentation

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

Delete ptr if active() otherwise do nothing

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

Generated on Sun Sep 27 2020 02:26:14 for yat by  doxygen 1.8.11