X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2Fsingleton.hh;h=831e8125d108a5d02d6c8cbb376ee91217252eb8;hb=a1a6c76a214ad1935032826713cabaf9ac57bf07;hp=e4bdbb621935c3008c0f22f93378301515c16ff9;hpb=ea8b2923c29a6902f507db2b485a44a58e9406f0;p=senf.git diff --git a/Utils/singleton.hh b/Utils/singleton.hh index e4bdbb6..831e812 100644 --- a/Utils/singleton.hh +++ b/Utils/singleton.hh @@ -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 @@ -55,15 +55,15 @@ namespace senf { : public senf::singleton { // Must have default constructor - SomeClass(); - + SomeClass(); + // Give singleton access to the constructor friend class senf::singleton; public: // By default 'instance()' is protected. If you want, you may make it public: using senf::singleton::instance; - + // ... }; @@ -74,7 +74,7 @@ namespace senf { SomeClass::instance().doSomething(); } \endcode - + \warning The singleton class should \e not have any static data members since it cannot be guaranteed, that these members will be constructed before the singleton instance. @@ -94,7 +94,7 @@ namespace senf { /** \brief Internal \internal */ - struct force_creation + struct force_creation { force_creation(); void nop() const;