Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (9 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/module/DynLib.cc

    r10540 r11071  
    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/trunk/src/libraries/core/module/DynLib.h

    r10541 r11071  
    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/trunk/src/libraries/core/module/DynLibManager.cc

    r10540 r11071  
    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/trunk/src/libraries/core/module/ModuleInstance.cc

    r10549 r11071  
    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/trunk/src/libraries/core/module/ModuleInstance.h

    r10549 r11071  
    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/trunk/src/libraries/core/module/Plugin.cc

    r11015 r11071  
    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    }
     
    7979    {
    8080        // only load module if it isn't already loaded. otherwise merely activate it.
    81         if (this->moduleInstance_ == NULL)
     81        if (this->moduleInstance_ == nullptr)
    8282            this->loadModule();
    8383        else
     
    112112        Core::getInstance().unloadModule(this->moduleInstance_);
    113113        delete this->moduleInstance_;
    114         this->moduleInstance_ = NULL;
     114        this->moduleInstance_ = nullptr;
    115115    }
    116116    void Plugin::deactivateModule()
  • code/trunk/src/libraries/core/module/PluginManager.cc

    r11017 r11071  
    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/trunk/src/libraries/core/module/StaticInitializationHandler.h

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

    r10535 r11071  
    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/trunk/src/libraries/core/module/StaticInitializationManager.cc

    r10542 r11071  
    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/trunk/src/libraries/core/module/StaticInitializationManager.h

    r10542 r11071  
    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.