Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2015, 2:16:55 PM (9 years ago)
Author:
landauf
Message:

clean and explicit setup/shutdown of singletons that are used by statically initialized instances

Location:
code/branches/core7/src/libraries/core/singleton
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/singleton/ScopeManager.cc

    r10538 r10542  
    3838namespace orxonox
    3939{
    40     /* static */ ScopeManager& ScopeManager::getInstance()
    41     {
    42         static ScopeManager instance;
    43         return instance;
    44     }
     40    ScopeManager* ScopeManager::singletonPtr_s = 0;
    4541
    4642    void ScopeManager::addScope(ScopeID::Value scope)
  • code/branches/core7/src/libraries/core/singleton/ScopeManager.h

    r10538 r10542  
    4141#include <set>
    4242
     43#include "util/Singleton.h"
     44
    4345namespace orxonox
    4446{
     
    5254        @see See @ref Scope "this description" for details about the interrelationship of Scope, ScopeListener, and ScopeManager.
    5355    */
    54     class _CoreExport ScopeManager
     56    class _CoreExport ScopeManager : public Singleton<ScopeManager>
    5557    {
     58        friend class Singleton<ScopeManager>;
     59
    5660        public:
    57             static ScopeManager& getInstance();
    58 
    5961            /** Adds a scope and activates all listeners which are registered for this scope */
    6062            void addScope(ScopeID::Value scope);
     
    7880            std::set<ScopeID::Value> activeScopes_;
    7981            std::map<ScopeID::Value, std::set<ScopeListener*> > listeners_; //!< Stores all listeners for a scope
     82
     83            static ScopeManager* singletonPtr_s;
    8084    };
    8185}
Note: See TracChangeset for help on using the changeset viewer.