Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 29, 2009, 10:27:10 PM (15 years ago)
Author:
rgrieder
Message:

Derived all singletons implemented in a usual manner from orxonox::Singleton<T>.
This resolves inconsistencies with the singletonPtr_s variable in case of exceptions (asserts were being triggered then).
And while at it replaced singletonRef_s with singletonPtr_s for it to be less misleading (as fabian has already pointed out).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/orxonox/overlays/console/InGameConsole.h

    r3327 r3366  
    3434
    3535#include <string>
     36
    3637#include "util/OgreForwardRefs.h"
     38#include "util/Singleton.h"
    3739#include "core/Shell.h"
    3840#include "core/WindowEventListener.h"
     
    4042namespace orxonox
    4143{
    42     class _OrxonoxExport InGameConsole : public ShellListener, public WindowEventListener
     44    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
    4345    {
     46        friend class Singleton<InGameConsole>;
    4447    public: // functions
    4548        InGameConsole();
     
    5154
    5255        void update(const Clock& time);
    53 
    54         static InGameConsole& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    55         static InGameConsole* getInstancePtr() { return singletonRef_s; }
    5656
    5757        static void openConsole();
     
    112112        bool bHidesAllInput_;
    113113
    114         static InGameConsole* singletonRef_s;
     114        static InGameConsole* singletonPtr_s;
    115115    };
    116116}
Note: See TracChangeset for help on using the changeset viewer.