Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 21, 2011, 6:27:30 PM (13 years ago)
Author:
landauf
Message:

moved filtering of sub-contexts from BaseWriter to a new interface SubcontextOutputListener

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/util/output/OutputListener.cc

    r8848 r8850  
    130130        OutputManager::getInstance().updateCombinedAdditionalContextsMask();
    131131    }
     132
     133    /**
     134        @brief Returns true if this listener accepts output of the given level and context, based on the levels and contexts masks.
     135    */
     136    bool OutputListener::acceptsOutput(OutputLevel level, const OutputContextContainer& context) const
     137    {
     138        // check if the output level is accepted by the level mask (independent of the context)
     139        if (this->levelMask_ & level)
     140            return true;
     141
     142        // check if the output context is accepted by the additional context mask and if the level matches as well
     143        if ((this->additionalContextsMask_ & context.mask) && (this->additionalContextsLevelMask_ & level))
     144            return true;
     145
     146        // otherwise we don't accept the output
     147        return false;
     148    }
    132149}
Note: See TracChangeset for help on using the changeset viewer.