Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 12:02:28 AM (15 years ago)
Author:
rgrieder
Message:

Modified Scoped Singleton concept: Derive from Singleton normally, but place an important pre-main() instruction in the source file: ManageScopedSingleton(className, scope) (it's a macro).
This causes the Singleton to be created and destroyed with the Scope. Thus if a Singleton c'tor throws, it is much easier to react accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/CameraManager.h

    r5850 r5867  
    4141#include <list>
    4242#include "util/OgreForwardRefs.h"
    43 #include "util/ScopedSingleton.h"
     43#include "util/Singleton.h"
    4444#include "core/OrxonoxClass.h"
    4545#include "core/SmartPtr.h"
     
    4747namespace orxonox
    4848{
    49     class _OrxonoxExport CameraManager : public ScopedSingleton<CameraManager, ScopeID::Graphics>, public OrxonoxClass
     49    class _OrxonoxExport CameraManager : public Singleton<CameraManager>, public OrxonoxClass
    5050    {
    51             friend class ScopedSingleton<CameraManager, ScopeID::Graphics>;
     51            friend class Singleton<CameraManager>;
    5252        public:
    5353            CameraManager();
Note: See TracChangeset for help on using the changeset viewer.