Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10508 for code


Ignore:
Timestamp:
May 30, 2015, 10:18:07 AM (9 years ago)
Author:
landauf
Message:

removed unused code from Loader

Location:
code/branches/core7/src
Files:
5 edited

Legend:

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

    r10479 r10508  
    117117        resources_.reset(new XMLFile("DefaultResources.oxr"));
    118118        resources_->setLuaSupport(false);
    119         Loader::getInstance().open(resources_.get(), ClassTreeMask(), false);
     119        Loader::getInstance().load(resources_.get(), ClassTreeMask(), false);
    120120
    121121        // Only for runs in the build directory (not installed)
     
    125125        extResources_.reset(new XMLFile("resources.oxr"));
    126126        extResources_->setLuaSupport(false);
    127         Loader::getInstance().open(extResources_.get(), ClassTreeMask(), false);
     127        Loader::getInstance().load(extResources_.get(), ClassTreeMask(), false);
    128128
    129129        if (bLoadRenderer)
     
    330330        orxout(internal_info) << "Loading Debug Overlay..." << endl;
    331331        debugOverlay_.reset(new XMLFile("debug.oxo"));
    332         Loader::getInstance().open(debugOverlay_.get(), ClassTreeMask(), false);
     332        Loader::getInstance().load(debugOverlay_.get(), ClassTreeMask(), false);
    333333    }
    334334
  • code/branches/core7/src/libraries/core/Loader.cc

    r10392 r10508  
    4949{
    5050    Loader* Loader::singletonPtr_s = 0;
    51 
    52     bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
    53     {
    54         this->add(file, mask);
    55         return this->load(file, mask, bVerbose);
    56     }
    57 
    58     void Loader::close()
    59     {
    60         this->unload();
    61         this->files_.clear();
    62     }
    63 
    64     void Loader::close(const XMLFile* file)
    65     {
    66         this->unload(file);
    67         this->remove(file);
    68     }
    69 
    70     void Loader::add(const XMLFile* file, const ClassTreeMask& mask)
    71     {
    72         if (!file)
    73             return;
    74         this->files_.insert(this->files_.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));
    75     }
    76 
    77     void Loader::remove(const XMLFile* file)
    78     {
    79         if (!file)
    80             return;
    81         for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
    82         {
    83             if (it->first == file)
    84             {
    85                 this->files_.erase(it);
    86                 break;
    87             }
    88         }
    89     }
    90 
    91     /**
    92     @brief
    93         Loads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
    94     @param mask
    95         A ClassTreeMask, which defines which types of classes are loaded and which aren't.
    96     @param bVerbose
    97         Whether the loader is verbose (prints its progress in a low output level) or not.
    98     @return
    99         Returns true if successful.
    100     */
    101     bool Loader::load(const ClassTreeMask& mask, bool bVerbose)
    102     {
    103         bool success = true;
    104         for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
    105             if (!this->load(it->first, it->second * mask, bVerbose))
    106                 success = false;
    107 
    108         return success;
    109     }
    110 
    111     void Loader::unload(const ClassTreeMask& mask)
    112     {
    113         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); )
    114         {
    115             if (mask.isIncluded(it->getIdentifier()))
    116                 (it++)->destroy();
    117             else
    118                 ++it;
    119         }
    120     }
    121 
    122     /**
    123     @brief
    124         Reloads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
    125     @param mask
    126         A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
    127     @param bVerbose
    128         Whether the loader is verbose (prints its progress in a low output level) or not.
    129     @return
    130         Returns true if successful.
    131     */
    132     bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
    133     {
    134         this->unload(mask);
    135         return this->load(mask, bVerbose);
    136     }
    13751
    13852    /**
     
    302216                ++it;
    303217        }
    304     }
    305 
    306     /**
    307     @brief
    308         Reloads the input file, while conforming to the restrictions given by the input ClassTreeMask.
    309     @param file
    310         The file to be reloaded.
    311     @param mask
    312         A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
    313     @param bVerbose
    314         Whether the loader is verbose (prints its progress in a low output level) or not.
    315     @return
    316         Returns true if successful.
    317     */
    318     bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
    319     {
    320         this->unload(file, mask);
    321         return this->load(file, mask, bVerbose);
    322218    }
    323219
  • code/branches/core7/src/libraries/core/Loader.h

    r10392 r10508  
    5555
    5656        public:
    57             bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    58             void close();
    59             void close(const XMLFile* file);
    60 
    61             void add(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
    62             void remove(const XMLFile* file);
    63 
    64             bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    65             void unload(const ClassTreeMask& mask = ClassTreeMask());
    66             bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    67 
    6857            bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
    6958                      bool bVerbose = true, bool bRemoveLuaTags = false);
    7059            void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
    71             bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
    7260
    7361            static std::string replaceLuaTags(const std::string& text);
  • code/branches/core7/src/orxonox/Level.cc

    r10392 r10508  
    9595        this->xmlfile_ = new XMLFile(mask, this->xmlfilename_);
    9696
    97         Loader::getInstance().open(this->xmlfile_);
     97        Loader::getInstance().load(this->xmlfile_);
    9898    }
    9999
  • code/branches/core7/src/orxonox/gamestates/GSLevel.cc

    r10479 r10508  
    168168        // call the loader
    169169        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
    170         bool loaded = Loader::getInstance().open(startFile_);
     170        bool loaded = Loader::getInstance().load(startFile_);
    171171
    172172        Core::getInstance().getConfig()->updateLastLevelTimestamp();
Note: See TracChangeset for help on using the changeset viewer.