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/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/class/IdentifierManager.cc

    r10520 r10542  
    4444namespace orxonox
    4545{
    46     /* static */ IdentifierManager& IdentifierManager::getInstance()
    47     {
    48         static IdentifierManager instance;
    49         return instance;
    50     }
     46    IdentifierManager* IdentifierManager::singletonPtr_s = 0;
    5147
    5248    IdentifierManager::IdentifierManager()
  • code/branches/core7/src/libraries/core/class/IdentifierManager.h

    r10520 r10542  
    4242#include <string>
    4343
     44#include "util/Singleton.h"
     45
    4446namespace orxonox
    4547{
    46     class _CoreExport IdentifierManager
     48    class _CoreExport IdentifierManager : public Singleton<IdentifierManager>
    4749    {
     50        friend class Singleton<IdentifierManager>;
     51
    4852        public:
    49             static IdentifierManager& getInstance();
     53            IdentifierManager();
     54            ~IdentifierManager() {}
    5055
    5156            void addIdentifier(Identifier* identifier);
     
    8893
    8994        private:
    90             IdentifierManager();
    91             IdentifierManager(const IdentifierManager&);
    92             ~IdentifierManager() {}
     95            IdentifierManager(const IdentifierManager&); // not implemented
    9396
    9497            /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
     
    110113            std::map<Identifiable*, std::list<const Identifier*> > identifierTraceOfNewObject_;
    111114            Identifier* recordTraceForIdentifier_; //!< The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded.
     115
     116            static IdentifierManager* singletonPtr_s;
    112117    };
    113118}
Note: See TracChangeset for help on using the changeset viewer.