Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1658 for code


Ignore:
Timestamp:
Aug 14, 2008, 8:52:04 PM (16 years ago)
Author:
rgrieder
Message:

ConfigFileManager::getSingleton —> getInstance()

Location:
code/branches/core3
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/core/ConfigFileManager.cc

    r1594 r1658  
    7171    void reloadConfig()
    7272    {
    73         ConfigFileManager::getSingleton()->load();
     73        ConfigFileManager::getInstance()->load();
    7474    }
    7575
    7676    void cleanConfig()
    7777    {
    78         ConfigFileManager::getSingleton()->clean(false);
     78        ConfigFileManager::getInstance()->clean(false);
    7979    }
    8080
    8181    void loadSettings(const std::string& filename)
    8282    {
    83         ConfigFileManager::getSingleton()->setFile(CFT_Settings, filename, false);
     83        ConfigFileManager::getInstance()->setFile(CFT_Settings, filename, false);
    8484    }
    8585
    8686    void loadKeybindings(const std::string& filename)
    8787    {
    88         ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, filename);
     88        ConfigFileManager::getInstance()->setFile(CFT_Keybindings, filename);
    8989    }
    9090
     
    459459    }
    460460
    461     ConfigFileManager* ConfigFileManager::getSingleton()
     461    ConfigFileManager* ConfigFileManager::getInstance()
    462462    {
    463463        static ConfigFileManager instance;
  • code/branches/core3/src/core/ConfigFileManager.h

    r1505 r1658  
    258258    {
    259259        public:
    260             static ConfigFileManager* getSingleton();
     260            static ConfigFileManager* getInstance();
    261261
    262262            void setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting = true);
  • code/branches/core3/src/core/ConfigValueContainer.cc

    r1611 r1658  
    8282        for (unsigned int i = 0; i < this->valueVector_.size(); i++)
    8383        {
    84             ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i].toString(), this->value_.isA(MT_string));
     84            ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i].toString(), this->value_.isA(MT_string));
    8585            this->defvalueStringVector_.push_back(this->valueVector_[i].toString());
    8686        }
     
    113113            if (this->tset(input))
    114114            {
    115                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input.toString(), this->value_.isA(MT_string));
     115                ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, input.toString(), this->value_.isA(MT_string));
    116116                return true;
    117117            }
     
    132132            if (this->tset(index, input))
    133133            {
    134                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input.toString(), this->value_.isA(MT_string));
     134                ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, index, input.toString(), this->value_.isA(MT_string));
    135135                return true;
    136136            }
     
    239239                this->valueVector_.erase(this->valueVector_.begin() + index);
    240240                for (unsigned int i = index; i < this->valueVector_.size(); i++)
    241                     ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
    242                 ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
     241                    ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
     242                ConfigFileManager::getInstance()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
    243243
    244244                return true;
     
    264264                if (!this->set(i, this->defvalueStringVector_[i]))
    265265                    success = false;
    266             ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->defvalueStringVector_.size());
     266            ConfigFileManager::getInstance()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->defvalueStringVector_.size());
    267267            return success;
    268268        }
     
    275275    {
    276276        if (!this->bIsVector_)
    277             this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));
     277            this->value_.fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));
    278278        else
    279279        {
    280280            this->valueVector_.clear();
    281             for (unsigned int i = 0; i < ConfigFileManager::getSingleton()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
     281            for (unsigned int i = 0; i < ConfigFileManager::getInstance()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
    282282            {
    283283                if (i < this->defvalueStringVector_.size())
    284284                {
    285                     this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));
     285                    this->value_.fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));
    286286                }
    287287                else
    288288                {
    289                     this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiTypeMath(), this->value_.isA(MT_string)));
     289                    this->value_.fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiTypeMath(), this->value_.isA(MT_string)));
    290290                }
    291291
  • code/branches/core3/src/core/input/KeyBinder.cc

    r1611 r1658  
    216216    if (!infile)
    217217    {
    218       ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "def_keybindings.ini");
    219       ConfigFileManager::getSingleton()->save(CFT_Keybindings, "keybindings.ini");
     218      ConfigFileManager::getInstance()->setFile(CFT_Keybindings, "def_keybindings.ini");
     219      ConfigFileManager::getInstance()->save(CFT_Keybindings, "keybindings.ini");
    220220    }
    221221    else
    222222      infile.close();
    223     ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
     223    ConfigFileManager::getInstance()->setFile(CFT_Keybindings, "keybindings.ini");
    224224
    225225    // parse key bindings
  • code/branches/core3/src/orxonox/Orxonox.cc

    r1594 r1658  
    184184  {
    185185#ifdef _DEBUG
    186     ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox_d.ini");
     186    ConfigFileManager::getInstance()->setFile(CFT_Settings, "orxonox_d.ini");
    187187#else
    188     ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
     188    ConfigFileManager::getInstance()->setFile(CFT_Settings, "orxonox.ini");
    189189#endif
    190190    Factory::createClassHierarchy();
  • code/branches/core3/visual_studio/base_properties.vsprops

    r1572 r1658  
    88        <Tool
    99                Name="VCCLCompilerTool"
    10                 AdditionalIncludeDirectories="&quot;$(RootDir)&quot;;&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(RootDir)src\tolua&quot;;&quot;$(RootDir)src\ois&quot;;&quot;$(LibDir)ogre-1.4.8\OgreMain\include&quot;;&quot;$(LibDir)boost-1.35.0&quot;;&quot;$(LibDir)enet-1.2\include&quot;;&quot;$(LibDir)libogg-1.1.3\include&quot;;&quot;$(LibDir)libvorbis-1.2.0\include&quot;;&quot;$(LibDir)lua-5.1.3\src&quot;;&quot;$(LibDir)openal-1.1\include&quot;;&quot;$(LibDir)openal-1.1\alut\include&quot;;&quot;$(LibDir)tcl-8.5.\generic&quot;;&quot;$(LibDir)zlib-1.2.3&quot;"
     10                AdditionalIncludeDirectories="&quot;$(RootDir)&quot;;&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(RootDir)src\tolua&quot;;&quot;$(RootDir)src\ois&quot;;&quot;$(LibDir)ogre-1.4.9\OgreMain\include&quot;;&quot;$(LibDir)boost-1.35.0&quot;;&quot;$(LibDir)enet-1.2\include&quot;;&quot;$(LibDir)libogg-1.1.3\include&quot;;&quot;$(LibDir)libvorbis-1.2.0\include&quot;;&quot;$(LibDir)lua-5.1.3\src&quot;;&quot;$(LibDir)openal-1.1\include&quot;;&quot;$(LibDir)openal-1.1\alut\include&quot;;&quot;$(LibDir)tcl-8.5.\generic&quot;;&quot;$(LibDir)zlib-1.2.3&quot;"
    1111                PreprocessorDefinitions="WIN32;__WIN32__;_WIN32;BOOST_ALL_DYN_LINK;OIS_DYNAMIC_LIB; ZLIB_WINAPI"
    1212                WarningLevel="3"
Note: See TracChangeset for help on using the changeset viewer.