- Timestamp:
- Aug 21, 2011, 11:18:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/util/output/BaseWriter.cc
r8850 r8853 27 27 */ 28 28 29 /** 30 @file 31 @brief Implementation of the BaseWriter class. 32 */ 33 29 34 #include "BaseWriter.h" 30 35 … … 33 38 namespace orxonox 34 39 { 40 /** 41 @brief Constructor: Initializes the config-values. 42 */ 35 43 BaseWriter::BaseWriter(const std::string& name, bool bRegister) : SubcontextOutputListener(bRegister) 36 44 { … … 46 54 } 47 55 56 /** 57 @brief Destructor. 58 */ 48 59 BaseWriter::~BaseWriter() 49 60 { 50 61 } 51 62 63 /** 64 @brief This function is inherited from OutputListener, each message is split into lines and sent to printLine(). 65 */ 52 66 void BaseWriter::output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines) 53 67 { … … 59 73 } 60 74 75 /** 76 @brief Overwritten implementation of the function inherited from OutputListener, sets also the corresponding config-value. 77 */ 61 78 void BaseWriter::setLevelMax(OutputLevel max) 62 79 { … … 65 82 } 66 83 84 /** 85 @brief Overwritten implementation of the function inherited from OutputListener, sets also the corresponding config-value. 86 */ 67 87 void BaseWriter::setAdditionalContextsLevelMax(OutputLevel max) 68 88 { … … 71 91 } 72 92 93 /** 94 @brief Called if the config value has changed, updates the corresponding mask in OutputListener. 95 */ 73 96 void BaseWriter::changedConfigurableLevel() 74 97 { … … 76 99 } 77 100 101 /** 102 @brief Called if the config value has changed, updates the corresponding mask in OutputListener. 103 */ 78 104 void BaseWriter::changedConfigurableAdditionalContextsLevel() 79 105 { … … 81 107 } 82 108 109 /** 110 @brief Called if the config-vector of accepted contexts has changed, updates the masks in SubcontextOutputListener. 111 */ 83 112 void BaseWriter::changedConfigurableAdditionalContexts() 84 113 { … … 86 115 std::set<const OutputContextContainer*> sub_contexts; 87 116 117 // iterate over all strings in the config-vector 88 118 for (size_t i = 0; i < this->configurableAdditionalContexts_.size(); ++i) 89 119 { 90 120 const std::string& full_name = this->configurableAdditionalContexts_[i]; 91 121 122 // split the name into main-name and sub-name (if given; otherwise sub-name remains empty). both names are separated by :: 92 123 std::string name = full_name; 93 124 std::string subname; … … 100 131 } 101 132 133 // get the context defined by this name 102 134 const OutputContextContainer& context = OutputManager::getInstance().registerContext(name, subname); 103 135 136 // if the context is a sub-context, insert it to the set of sub-contexts. Otherwise add it's mask to the mask of main-contexts. 104 137 if (context.sub_id == context::no_subcontext) 105 138 main_contexts |= context.mask; … … 108 141 } 109 142 143 // pass main-contexts and sub-contexts to SubcontextOutputListener 110 144 this->setAdditionalContextsMask(main_contexts); 111 145 this->setAdditionalSubcontexts(sub_contexts);
Note: See TracChangeset
for help on using the changeset viewer.