Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/core/module/DynLib.cc

    r10540 r11054  
    5656    {
    5757        mName = name;
    58         m_hInst = NULL;
     58        m_hInst = nullptr;
    5959    }
    6060
     
    127127            FORMAT_MESSAGE_FROM_SYSTEM |
    128128            FORMAT_MESSAGE_IGNORE_INSERTS,
    129             NULL,
     129            nullptr,
    130130            GetLastError(),
    131131            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    132132            (LPTSTR) &lpMsgBuf,
    133133            0,
    134             NULL
     134            nullptr
    135135            );
    136136        std::string ret = (char*)lpMsgBuf;
  • code/branches/cpp11_v3/src/libraries/core/module/DynLib.h

    r10541 r11054  
    4545#if defined(ORXONOX_PLATFORM_WINDOWS)
    4646#    define DYNLIB_HANDLE hInstance
    47 #    define DYNLIB_LOAD( a ) LoadLibraryEx( a, NULL, LOAD_WITH_ALTERED_SEARCH_PATH )
     47#    define DYNLIB_LOAD( a ) LoadLibraryEx( a, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH )
    4848#    define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
    4949#    define DYNLIB_UNLOAD( a ) !FreeLibrary( a )
     
    104104                the symbol.
    105105            @par
    106                 If the function fails, the returned value is <b>NULL</b>.
     106                If the function fails, the returned value is <b>nullptr</b>.
    107107
    108108        */
  • code/branches/cpp11_v3/src/libraries/core/module/DynLibManager.cc

    r10540 r11054  
    3838    //-----------------------------------------------------------------------
    3939    //! Static pointer to the singleton
    40     DynLibManager* DynLibManager::singletonPtr_s  = 0;
     40    DynLibManager* DynLibManager::singletonPtr_s  = nullptr;
    4141
    4242    //-----------------------------------------------------------------------
     
    7575    {
    7676        // Unload & delete resources in turn
    77         for (DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it)
     77        for (const auto& mapEntry : mLibList)
    7878        {
    79             it->second->unload();
    80             delete it->second;
     79            mapEntry.second->unload();
     80            delete mapEntry.second;
    8181        }
    8282
  • code/branches/cpp11_v3/src/libraries/core/module/ModuleInstance.cc

    r10549 r11054  
    3333namespace orxonox
    3434{
    35     ModuleInstance* ModuleInstance::currentModuleInstance_s = NULL;
     35    ModuleInstance* ModuleInstance::currentModuleInstance_s = nullptr;
    3636
    3737    ModuleInstance::ModuleInstance(const std::string& libraryName)
    3838        : libraryName_(libraryName)
    39         , dynLib_(NULL)
     39        , dynLib_(nullptr)
    4040    {
    4141    }
     
    5959    {
    6060        const std::set<StaticallyInitializedInstance*>& instances = this->staticallyInitializedInstancesByType_[type];
    61         for (std::set<StaticallyInitializedInstance*>::iterator it = instances.begin(); it != instances.end(); ++it)
    62             (*it)->load();
     61        for (StaticallyInitializedInstance* instance : instances)
     62            instance->load();
    6363    }
    6464
     
    7373    void ModuleInstance::deleteAllStaticallyInitializedInstances()
    7474    {
    75         std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*> > copy(this->staticallyInitializedInstancesByType_);
     75        std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> copy(this->staticallyInitializedInstancesByType_);
    7676        this->staticallyInitializedInstancesByType_.clear();
    77         for (std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*> >::iterator it1 = copy.begin(); it1 != copy.end(); ++it1)
    78             for (std::set<StaticallyInitializedInstance*>::iterator it2 = it1->second.begin(); it2 != it1->second.end(); ++it2)
    79                 delete (*it2);
     77        for (const auto& mapEntry : copy)
     78            for (StaticallyInitializedInstance* instance : mapEntry.second)
     79                delete instance;
    8080    }
    8181
  • code/branches/cpp11_v3/src/libraries/core/module/ModuleInstance.h

    r10549 r11054  
    6969
    7070        private:
    71             std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*> > staticallyInitializedInstancesByType_;
     71            std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> staticallyInitializedInstancesByType_;
    7272            std::string libraryName_;
    7373            DynLib* dynLib_;
  • code/branches/cpp11_v3/src/libraries/core/module/Plugin.cc

    r11015 r11054  
    3939    {
    4040        this->referenceCounter_ = 0;
    41         this->moduleInstance_ = NULL;
     41        this->moduleInstance_ = nullptr;
    4242    }
    4343
     
    4545    {
    4646        // force unloading of the module when the plugin is destroyed
    47         if (this->moduleInstance_ != NULL)
     47        if (this->moduleInstance_ != nullptr)
    4848            this->unloadModule();
    4949    }
  • code/branches/cpp11_v3/src/libraries/core/module/PluginManager.cc

    r11017 r11054  
    5454    SetConsoleCommand("PluginManager", __CC_PluginManager_unload_name, &PluginManager::unloadPlugin);
    5555
    56     PluginManager* PluginManager::singletonPtr_s  = 0;
     56    PluginManager* PluginManager::singletonPtr_s  = nullptr;
    5757
    5858    RegisterAbstractClass(PluginManager).inheritsFrom<Configurable>();
     
    7070    PluginManager::~PluginManager()
    7171    {
    72         ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(NULL);
    73         ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(NULL);
     72        ModifyConsoleCommand("PluginManager", __CC_PluginManager_load_name).setObject(nullptr);
     73        ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr);
    7474
    75         for (std::map<std::string, PluginReference*>::iterator it = this->references_.begin(); it != this->references_.end(); ++it)
    76             delete it->second;
    77         for (std::map<std::string, Plugin*>::iterator it = this->plugins_.begin(); it != this->plugins_.end(); ++it)
    78             delete it->second;
     75        for (const auto& mapEntry : this->references_)
     76            delete mapEntry.second;
     77        for (const auto& mapEntry : this->plugins_)
     78            delete mapEntry.second;
    7979    }
    8080
     
    9696    {
    9797        const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
    98         for (std::vector<std::string>::const_iterator it = pluginPaths.begin(); it != pluginPaths.end(); ++it)
     98        for (const std::string& libraryName : pluginPaths)
    9999        {
    100100            std::string name;
    101             std::string libraryName = (*it);
    102101            std::string filename = libraryName +  + specialConfig::pluginExtension;
    103102            std::ifstream infile(filename.c_str());
     
    117116    {
    118117        Plugin* plugin = this->plugins_[name];
    119         if (plugin != NULL)
     118        if (plugin != nullptr)
    120119            plugin->reference();
    121120        else
     
    126125    {
    127126        Plugin* plugin = this->plugins_[name];
    128         if (plugin != NULL)
     127        if (plugin != nullptr)
    129128            plugin->dereference(this->bMerelyDeactivatePlugins_);
    130129        else
     
    137136    void PluginManager::loadPlugin(const std::string& name)
    138137    {
    139         if (this->references_[name] == NULL)
     138        if (this->references_[name] == nullptr)
    140139        {
    141140            this->references_[name] = new PluginReference(name);
     
    152151    {
    153152        PluginReference* reference = this->references_[name];
    154         if (reference != NULL)
     153        if (reference != nullptr)
    155154        {
    156             this->references_[name] = NULL;
     155            this->references_[name] = nullptr;
    157156            delete reference;
    158157        }
  • code/branches/cpp11_v3/src/libraries/core/module/StaticInitializationHandler.h

    r10532 r11054  
    3737    {
    3838        public:
    39             StaticInitializationHandler() {}
    40             virtual ~StaticInitializationHandler() {}
     39            StaticInitializationHandler() = default;
     40            virtual ~StaticInitializationHandler() = default;
    4141
    4242            virtual void setupHandler() = 0;
  • code/branches/cpp11_v3/src/libraries/core/module/StaticInitializationHandlerIncludes.h

    r10535 r11054  
    5353            ~StaticallyInitializedStaticInitializationHandler() { delete handler_; }
    5454
    55             virtual void load();
    56             virtual void unload();
     55            virtual void load() override;
     56            virtual void unload() override;
    5757
    5858            inline StaticInitializationHandler& getHandler()
  • code/branches/cpp11_v3/src/libraries/core/module/StaticInitializationManager.cc

    r10542 r11054  
    3333namespace orxonox
    3434{
    35     StaticInitializationManager* StaticInitializationManager::singletonPtr_s = 0;
     35    StaticInitializationManager* StaticInitializationManager::singletonPtr_s = nullptr;
    3636
    3737    void StaticInitializationManager::addHandler(StaticInitializationHandler* handler)
     
    5050    {
    5151        // attention: loading a module may add new handlers to the list
    52         for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it)
    53             (*it)->loadModule(module);
     52        for (StaticInitializationHandler* handler : this->handlers_)
     53            handler->loadModule(module);
    5454    }
    5555
  • code/branches/cpp11_v3/src/libraries/core/module/StaticInitializationManager.h

    r10542 r11054  
    4343
    4444        public:
    45             StaticInitializationManager() {}
    46             virtual ~StaticInitializationManager() {}
     45            StaticInitializationManager() = default;
     46            virtual ~StaticInitializationManager() = default;
    4747
    4848            void addHandler(StaticInitializationHandler* handler);
Note: See TracChangeset for help on using the changeset viewer.