Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SelfDestructor< TAR > Class Template Reference

#include "lib/several.hpp"

Description

template<class TAR>
class lib::several::SelfDestructor< TAR >

mix-in for self-destruction capabilities

Remarks
the destructor function is assumed to perform deallocation; thus the functor is moved in the local stack frame, where it can be invoked safely; this also serves to prevent re-entrance.

Definition at line 79 of file several.hpp.

Public Member Functions

template<class FUN >
void installDestructor (FUN &&dtor)
 
 ~SelfDestructor ()
 
bool isArmed () const
 
auto getDtor () const
 
void destroy ()
 
TAR * target ()
 

Private Attributes

std::function< void(TAR *)> dtor_ {}
 

Constructor & Destructor Documentation

◆ ~SelfDestructor()

template<class TAR >
~SelfDestructor ( )
inline

Definition at line 91 of file several.hpp.

References SelfDestructor< TAR >::dtor_, SelfDestructor< TAR >::isArmed(), and SelfDestructor< TAR >::target().

+ Here is the call graph for this function:

Member Function Documentation

◆ installDestructor()

template<class TAR >
template<class FUN >
void installDestructor ( FUN &&  dtor)
inline

Definition at line 86 of file several.hpp.

References SelfDestructor< TAR >::dtor_.

◆ isArmed()

template<class TAR >
bool isArmed ( ) const
inline

Definition at line 101 of file several.hpp.

References SelfDestructor< TAR >::dtor_.

Referenced by SelfDestructor< TAR >::~SelfDestructor().

+ Here is the caller graph for this function:

◆ getDtor()

template<class TAR >
auto getDtor ( ) const
inline

Definition at line 102 of file several.hpp.

References SelfDestructor< TAR >::dtor_.

◆ destroy()

template<class TAR >
void destroy ( )
inline

Definition at line 103 of file several.hpp.

References SelfDestructor< TAR >::target().

Referenced by Several< I >::~Several().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ target()

template<class TAR >
TAR * target ( )
inline

Definition at line 104 of file several.hpp.

Referenced by SelfDestructor< TAR >::~SelfDestructor(), and SelfDestructor< TAR >::destroy().

+ Here is the caller graph for this function:

Member Data Documentation

◆ dtor_

template<class TAR >
std::function<void(TAR*)> dtor_ {}
private
+ Inheritance diagram for SelfDestructor< TAR >:
+ Collaboration diagram for SelfDestructor< TAR >:

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