X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fsingleton.cti;h=79dd1f761068001344dad80eec9cfe942f72f815;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=f549082908e8ec9d89cfb275075cbf46f430b2d4;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Utils/singleton.cti b/Utils/singleton.cti index f549082..79dd1f7 100644 --- a/Utils/singleton.cti +++ b/Utils/singleton.cti @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -31,15 +31,36 @@ ///////////////////////////////cti.p/////////////////////////////////////// template +prefix_ senf::singleton::singleton() +{ + alive_ = true; +} + +template +prefix_ senf::singleton::~singleton() +{ + alive_ = false; +} + +template +bool senf::singleton::alive_ (false); + +template prefix_ Self & senf::singleton::instance() { static Self instance_; // Force instantiation of force_creation (at static object creation time) - creator_.nop(); + creator_.nop(); return instance_; } template +prefix_ bool senf::singleton::alive() +{ + return alive_; +} + +template prefix_ senf::singleton::force_creation::force_creation() { // Force execution of instance() thereby creating instance