Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2015, 11:42:16 PM (9 years ago)
Author:
landauf
Message:

some refactoring in ScopeManager. made it a singleton and added functions.

File:
1 edited

Legend:

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

    r10461 r10462  
    5454    class _CoreExport ScopeManager
    5555    {
    56         template <ScopeID::Value scope>
    57         friend class Scope;
    58         friend class StaticallyInitializedScopedSingletonWrapper;
     56        public:
     57            static ScopeManager& getInstance();
     58
     59            void addListener(ScopeListener* listener);
     60            void removeListener(ScopeListener* listener);
     61
     62            inline int& getInstanceCount(ScopeID::Value scope)
     63                { return this->instanceCounts_[scope]; }
     64            inline std::set<ScopeListener*>& getListeners(ScopeID::Value scope)
     65                { return this->listeners_[scope]; }
    5966
    6067        private:
    61             static std::map<ScopeID::Value, int>& getInstanceCounts();                  //!< Counts the number of active instances (>0 means active) for a scope
    62             static std::map<ScopeID::Value, std::set<ScopeListener*> >& getListeners(); //!< Stores all listeners for a scope
     68            std::map<ScopeID::Value, int> instanceCounts_;                  //!< Counts the number of active instances (>0 means active) for a scope
     69            std::map<ScopeID::Value, std::set<ScopeListener*> > listeners_; //!< Stores all listeners for a scope
    6370    };
    6471}
Note: See TracChangeset for help on using the changeset viewer.