The Vish Visualization Shell 0.3
Vish
Static Public Member Functions | List of all members
MemCore::PreDestructionTrait< Object > Struct Template Reference

Trait class that allows to execute some action on an object when it is going to be deleted. More...

#include <elementary/memcore/DynPtr.hpp>

Static Public Member Functions

static void predestruct (Object *)
 Function that is called for the particular object just before it will be deleted.
 

Detailed Description

template<class Object>
struct MemCore::PreDestructionTrait< Object >

Trait class that allows to execute some action on an object when it is going to be deleted.

While this function is called, the object is still full constructed, whereas in a destructor there must not be any virtual function calls. Since this function is called through the reference point mechanism, and there is no other way to destruct an object than through deleting its last strong reference pointer, calling this function is equivalent to a destructor call, i.e. it is ensured this function will be called when an object of the specified type is going to be deleted.