Changeset 8808 for code/branches/output/src
- Timestamp:
- Jul 31, 2011, 11:42:55 PM (13 years ago)
- Location:
- code/branches/output/src/libraries
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/Loader.cc
r8806 r8808 93 93 @param mask 94 94 A ClassTreeMask, which defines which types of classes are loaded and which aren't. 95 @param verbose95 @param bVerbose 96 96 Whether the loader is verbose (prints its progress in a low output level) or not. 97 97 @return 98 98 Returns true if successful. 99 99 */ 100 bool Loader::load(const ClassTreeMask& mask, bool verbose)100 bool Loader::load(const ClassTreeMask& mask, bool bVerbose) 101 101 { 102 102 bool success = true; 103 103 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it) 104 if (!Loader::load(it->first, it->second * mask, verbose))104 if (!Loader::load(it->first, it->second * mask, bVerbose)) 105 105 success = false; 106 106 … … 124 124 @param mask 125 125 A ClassTreeMask, which defines which types of classes are reloaded and which aren't. 126 @param verbose126 @param bVerbose 127 127 Whether the loader is verbose (prints its progress in a low output level) or not. 128 128 @return 129 129 Returns true if successful. 130 130 */ 131 bool Loader::reload(const ClassTreeMask& mask, bool verbose)131 bool Loader::reload(const ClassTreeMask& mask, bool bVerbose) 132 132 { 133 133 Loader::unload(mask); 134 return Loader::load(mask, verbose);134 return Loader::load(mask, bVerbose); 135 135 } 136 136 … … 142 142 @param mask 143 143 A ClassTreeMask, which defines which types of classes are loaded and which aren't. 144 @param verbose144 @param bVerbose 145 145 Whether the loader is verbose (prints its progress in a low output level) or not. 146 146 @param bRemoveLuaTags … … 149 149 Returns true if successful. 150 150 */ 151 bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose, bool bRemoveLuaTags)151 bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose, bool bRemoveLuaTags) 152 152 { 153 153 if (!file) … … 187 187 try 188 188 { 189 if( verbose)189 if(bVerbose) 190 190 { 191 191 orxout(user_status, context::loader) << "Start loading " << file->getFilename() << "..." << endl; … … 216 216 rootNamespace->XMLPort(rootElement, XMLPort::LoadObject); 217 217 218 if( verbose)218 if(bVerbose) 219 219 orxout(user_status, context::loader) << "Finished loading " << file->getFilename() << '.' << endl; 220 220 else … … 271 271 @param mask 272 272 A ClassTreeMask, which defines which types of classes are reloaded and which aren't. 273 @param verbose273 @param bVerbose 274 274 Whether the loader is verbose (prints its progress in a low output level) or not. 275 275 @return 276 276 Returns true if successful. 277 277 */ 278 bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool verbose)278 bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose) 279 279 { 280 280 Loader::unload(file, mask); 281 return Loader::load(file, mask, verbose);281 return Loader::load(file, mask, bVerbose); 282 282 } 283 283 … … 339 339 orxout(internal_error, context::loader) << "Error in level file" << endl; 340 340 // TODO: error handling 341 return false; 341 return false; 342 342 } 343 343 } -
code/branches/output/src/libraries/core/Loader.h
r8079 r8808 58 58 static void remove(const XMLFile* file); 59 59 60 static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);60 static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true); 61 61 static void unload(const ClassTreeMask& mask = ClassTreeMask()); 62 static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);62 static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true); 63 63 64 64 static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), 65 bool verbose = true, bool bRemoveLuaTags = false);65 bool bVerbose = true, bool bRemoveLuaTags = false); 66 66 static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask()); 67 static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);67 static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true); 68 68 69 69 static std::string replaceLuaTags(const std::string& text); -
code/branches/output/src/libraries/core/command/Shell.cc
r8803 r8808 170 170 if (isNormal) 171 171 { 172 ModifyConfigValueExternal( debugLevel_, this->getConfigurableMaxLevelName(), update);172 ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), update); 173 173 } 174 174 else 175 175 { 176 176 OutputLevel level = (value ? DefaultLogLevel::Dev : DefaultLogLevel::User); 177 ModifyConfigValueExternal( debugLevel_, this->getConfigurableMaxLevelName(), tset, level);177 ModifyConfigValueExternal(this->configurableMaxLevel_, this->getConfigurableMaxLevelName(), tset, level); 178 178 } 179 179 } -
code/branches/output/src/libraries/core/command/Shell.h
r8805 r8808 200 200 unsigned int historyOffset_; ///< The command history is a circular buffer, this variable defines the current write-offset 201 201 std::vector<std::string> commandHistory_; ///< The history of commands that were entered by the user 202 OutputLevel debugLevel_; //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)203 202 static unsigned int cacheSize_s; ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass 204 203 }; -
code/branches/output/src/libraries/util/Output.h
r8787 r8808 37 37 // Just for convenience 38 38 using std::endl; 39 using namespace level;40 39 41 40 inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContext context = context::undefined()) -
code/branches/output/src/libraries/util/output/BaseWriter.cc
r8799 r8808 65 65 void BaseWriter::changedConfigurableLevels() 66 66 { 67 OutputLevelmax_level = std::max(this->configurableMaxLevel_, this->configurableContextsMaxLevel_);68 OutputListener::setLevelMax( max_level);67 int max_level = std::max(this->configurableMaxLevel_, this->configurableContextsMaxLevel_); 68 OutputListener::setLevelMax(static_cast<OutputLevel>(max_level)); 69 69 } 70 70 -
code/branches/output/src/libraries/util/output/BaseWriter.h
r8799 r8808 50 50 void setLevelMax(OutputLevel max); 51 51 52 OutputLevelconfigurableMaxLevel_;52 int configurableMaxLevel_; 53 53 inline std::string getConfigurableMaxLevelName() const 54 54 { return "outputLevel" + this->name_; } 55 55 56 OutputLevelconfigurableContextsMaxLevel_;56 int configurableContextsMaxLevel_; 57 57 inline std::string getConfigurableContextsMaxLevelName() const 58 58 { return "outputContextsLevel" + this->name_; } -
code/branches/output/src/libraries/util/output/OutputDefinitions.h
r8807 r8808 38 38 namespace orxonox 39 39 { 40 typedef uint16_t OutputLevel;41 42 40 namespace level 43 41 { 44 static const OutputLevel all = 0xFFFF; 45 static const OutputLevel none = 0x0000; 42 enum OutputLevel 43 { 44 all = 0xFFFF, 45 none = 0x0000, 46 46 47 static const OutputLevel message = 0x0001; 48 static const OutputLevel debug_output = 0x0002; 49 static const OutputLevel user_error = 0x0004; 50 static const OutputLevel user_warning = 0x0008; 51 static const OutputLevel user_status = 0x0010; 52 static const OutputLevel user_info = 0x0020; 53 static const OutputLevel internal_error = 0x0040; 54 static const OutputLevel internal_warning = 0x0080; 55 static const OutputLevel internal_status = 0x0100; 56 static const OutputLevel internal_info = 0x0200; 57 static const OutputLevel verbose = 0x0400; 58 static const OutputLevel verbose_more = 0x0800; 59 static const OutputLevel verbose_ultra = 0x1000; 47 message = 0x0001, 48 debug_output = 0x0002, 49 user_error = 0x0004, 50 user_warning = 0x0008, 51 user_status = 0x0010, 52 user_info = 0x0020, 53 internal_error = 0x0040, 54 internal_warning = 0x0080, 55 internal_status = 0x0100, 56 internal_info = 0x0200, 57 verbose = 0x0400, 58 verbose_more = 0x0800, 59 verbose_ultra = 0x1000 60 }; 60 61 } 62 63 using namespace level; 61 64 62 65 typedef uint64_t OutputContext; -
code/branches/output/src/libraries/util/output/OutputListener.cc
r8787 r8808 48 48 void OutputListener::setLevelMax(OutputLevel max) 49 49 { 50 this->setLevelRange( level::debug_output, max);50 this->setLevelRange(static_cast<OutputLevel>(0x1), max); 51 51 } 52 52 53 53 void OutputListener::setLevelRange(OutputLevel min, OutputLevel max) 54 54 { 55 OutputLevel mask = 0; 56 57 for (OutputLevel level = min; level <= max; level = level << 1) 55 int mask = 0; 56 for (int level = min; level <= max; level = level << 1) 58 57 mask |= level; 59 58 60 this->setLevelMask( mask);59 this->setLevelMask(static_cast<OutputLevel>(mask)); 61 60 } 62 61 -
code/branches/output/src/libraries/util/output/OutputManager.cc
r8805 r8808 38 38 OutputManager::OutputManager() 39 39 { 40 this->combinedLevelMask_ = 0;40 this->combinedLevelMask_ = level::none; 41 41 this->combinedContextMask_ = 0; 42 42 } … … 99 99 void OutputManager::updateCombinedLevelMask() 100 100 { 101 this->combinedLevelMask_= 0;101 int mask = 0; 102 102 for (size_t i = 0; i < this->listeners_.size(); ++i) 103 this->combinedLevelMask_ |= this->listeners_[i]->getLevelMask(); 103 mask |= this->listeners_[i]->getLevelMask(); 104 this->combinedLevelMask_ = static_cast<OutputLevel>(mask); 104 105 } 105 106
Note: See TracChangeset
for help on using the changeset viewer.