- 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/SubcontextOutputListener.h
r8850 r8853 44 44 namespace orxonox 45 45 { 46 /** 47 @brief This class extends the basic OutputListener interface and adds the ability to filter sub-contexts. 48 49 Defining additional contexts with setAdditionalContextsMask() enables 50 all sub-contexts of these additional contexts. To accept only some 51 particular sub-contexts, setAdditionalSubcontexts() has to be used. 52 Note that this requires a set, since a mask is not possible with 53 sub-contexts. 54 55 The "final" context mask which will be seen by OutputManager is the 56 combination of all regular contexts plus the masks of all sub-contexts. 57 58 @remark 59 It would have been possible to implement filtering of sub-contexts 60 directly in OutputListener and even to make OutputManager aware of 61 sub-contexts. This would reduce the amount of unnecessarily generated 62 output, but also increase the complexity of the checks whether some 63 output is needed. 64 On the other hand, filtering of sub-contexts makes the whole concept 65 more complicated, as it adds another mask and a set. So to keep it 66 clean and simple I figured it's best to put sub-context filtering into 67 a seaparate class. 68 */ 46 69 class _UtilExport SubcontextOutputListener : public OutputListener 47 70 { … … 56 79 57 80 private: 58 OutputContextMask subcontextsCheckMask_; 59 OutputContextMask subcontextsNoCheckMask_; 60 std::set<OutputContextSubID> subcontexts_; 81 OutputContextMask subcontextsCheckMask_; ///< All contexts defined by this mask need to be checked whether they are accepted by the set of sub-contexts 82 OutputContextMask subcontextsNoCheckMask_; ///< All contexts defined by this mask don't need to be checked since we accept all sub-contexts 83 std::set<OutputContextSubID> subcontexts_; ///< The set of accepted sub-contexts 61 84 }; 62 85 }
Note: See TracChangeset
for help on using the changeset viewer.