Changeset 8834 for code/branches/output/src
- Timestamp:
- Aug 12, 2011, 12:26:40 AM (13 years ago)
- Location:
- code/branches/output/src/libraries
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/core/command/Shell.cc
r8833 r8834 39 39 #include "util/StringUtils.h" 40 40 #include "util/SubString.h" 41 #include "util/output/OutputManager.h" 41 42 #include "util/output/MemoryWriter.h" 42 43 #include "core/CoreIncludes.h" … … 71 72 */ 72 73 Shell::Shell(const std::string& consoleName, bool bScrollable) 73 : BaseWriter(consoleName )74 : BaseWriter(consoleName, false) 74 75 , inputBuffer_(new InputBuffer()) 75 76 , bScrollable_(bScrollable) 76 77 { 77 78 RegisterRootObject(Shell); 79 80 OutputManager::getInstance().registerListener(this); 78 81 79 82 this->scrollPosition_ = 0; … … 104 107 { 105 108 this->inputBuffer_->destroy(); 109 110 OutputManager::getInstance().unregisterListener(this); 106 111 } 107 112 -
code/branches/output/src/libraries/util/output/BaseWriter.cc
r8833 r8834 33 33 namespace orxonox 34 34 { 35 BaseWriter::BaseWriter(const std::string& name )35 BaseWriter::BaseWriter(const std::string& name, bool bRegister) : OutputListener(bRegister) 36 36 { 37 37 this->name_ = name; … … 42 42 43 43 this->subcontextsCheckMask_ = context::none; 44 this->subcontextsNoCheckMask_ = context::none; 44 45 45 46 this->changedConfigurableLevel(); … … 54 55 void BaseWriter::output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines) 55 56 { 56 if (((this->subcontextsCheckMask_ & context.mask) == 0) || (this->subcontexts_.find(context.sub_id) != this->subcontexts_.end())) 57 if (((this->subcontextsCheckMask_ & context.mask) == 0) || 58 (this->subcontextsNoCheckMask_ & context.mask) || 59 (this->subcontexts_.find(context.sub_id) != this->subcontexts_.end())) 57 60 { 58 61 const std::string& prefix = OutputManager::getInstance().getDefaultPrefix(level, context); … … 90 93 OutputContextMask context_mask = context::none; 91 94 this->subcontextsCheckMask_ = context::none; 95 this->subcontextsNoCheckMask_ = context::none; 92 96 93 97 this->subcontexts_.clear(); 94 this->subcontexts_.insert(context::no_subcontext);95 98 96 99 for (size_t i = 0; i < this->configurableAdditionalContexts_.size(); ++i) … … 117 120 this->subcontextsCheckMask_ |= container.mask; 118 121 } 122 else 123 { 124 this->subcontextsNoCheckMask_ |= container.mask; 125 } 119 126 } 120 127 -
code/branches/output/src/libraries/util/output/BaseWriter.h
r8833 r8834 42 42 { 43 43 public: 44 BaseWriter(const std::string& name );44 BaseWriter(const std::string& name, bool bRegister = true); 45 45 virtual ~BaseWriter(); 46 46 … … 85 85 86 86 OutputContextMask subcontextsCheckMask_; 87 OutputContextMask subcontextsNoCheckMask_; 87 88 std::set<OutputContextSubID> subcontexts_; 88 89 }; -
code/branches/output/src/libraries/util/output/OutputListener.cc
r8833 r8834 33 33 namespace orxonox 34 34 { 35 OutputListener::OutputListener( )35 OutputListener::OutputListener(bool bRegister) 36 36 { 37 37 this->levelMask_ = level::none; … … 39 39 this->additionalContextsMask_ = context::none; 40 40 41 OutputManager::getInstance().registerListener(this); 41 if (bRegister) 42 OutputManager::getInstance().registerListener(this); 42 43 } 43 44 -
code/branches/output/src/libraries/util/output/OutputListener.h
r8833 r8834 41 41 { 42 42 public: 43 OutputListener( );43 OutputListener(bool bRegister = true); 44 44 virtual ~OutputListener(); 45 45
Note: See TracChangeset
for help on using the changeset viewer.