#include <SPCachedFactory.h>
Public Types | |
typedef T * | StoredType |
the type of the pointee_ object | |
typedef T * | InitPointerType |
type used to declare OwnershipPolicy type. | |
typedef T * | PointerType |
type returned by operator-> | |
typedef T & | ReferenceType |
type returned by operator* | |
typedef Functor< void, Seq < void * > > | FunctorType |
type of the Functor to set | |
Public Member Functions | |
void | SetCallBackFunction (const FunctorType &functor) |
This storage policy is used by SmartPointer CachedFactory's encapsulation policy. It's purpose is to call a Functor instead of deleting the underlying pointee object. You have to set the callback functor by calling SetCallBackFunction(const FunctorType &functor).
Unfortunately, the functor argument is not a reference to the SmartPtr but a void *. Making functor argument a reference to the pointer would require the FunctionStorage template to know the full definition of the SmartPtr.
void Loki::FunctionStorage< T >::SetCallBackFunction | ( | const FunctorType & | functor | ) | [inline] |
Sets the callback function to call. You have to specify it or the smartPtr will throw a bad_function_call exception.