Lifetime policies

Collaboration diagram for Lifetime policies:




struct  Loki::DefaultLifetime< T >
struct  Loki::PhoenixSingleton< T >
struct  Loki::DeletableSingleton< T >
struct  Loki::SingletonWithLongevity< T >
struct  Loki::NoDestroy< T >
class  Loki::FollowIntoDeath


template<typename T, typename Destroyer>
void Loki::SetLongevity (T *pDynObject, unsigned int longevity, Destroyer d)

Detailed Description

The lifetimes of the singleton.
Special lifetime for SmallObjects
When the holded object is a Small(Value)Object or the holded object uses objects which are or inherit from Small(Value)Object then you can't use the default lifetime: you must use the lifetime Be aware of this when you use Loki::Factory, Loki::Functor, or Loki::Function.

Function Documentation

template<typename T, typename Destroyer>
void Loki::SetLongevity ( T *  pDynObject,
unsigned int  longevity,
Destroyer  d 

Assigns an object a longevity; ensures ordered destructions of objects registered thusly during the exit sequence of the application

Definition at line 148 of file Singleton.h.

References Loki::Private::AtExitFn().

Referenced by Loki::OrderedStatic< L, T, P1(*)() >::createObject(), Loki::OrderedStatic< L, T, Loki::Seq< P1 > >::createObject(), Loki::OrderedStatic< L, T, Loki::NullType >::createObject(), Loki::LongevityLifetime::SingletonFixedLongevity< 0, T >::ScheduleDestruction(), Loki::SingletonWithLongevity< T >::ScheduleDestruction(), and Loki::Private::OrderedStaticBase< T >::SetLongevity().

Here is the call graph for this function:

Generated on Sun Feb 25 16:52:29 2007 for Loki by  doxygen 1.5.1-p1