Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 11, 2011, 11:20:39 PM (13 years ago)
Author:
landauf
Message:

A context is now defined by a struct instead of only a mask.

Introduced sub-contexts. Sub-contexts of the same main-context share the same mask, but have a different ID.
Main-contexts are filtered using a bitmask which happens for every line of output and is very fast.
Sub-contexts are filtered using a set which is slow but happens only if a specific sub-context is enabled in the config file which is usually not the case.

The concept of filtering normal output + additional contexts was moved from BaseWriter directly to OutputListener and OutputManager which makes the whole system faster.
BaseWriter now calls registerContext() for each configured output context, which basically allows the usage of more than 64 contexts as long as these contexts are not used before loading the config file. Though by design it's not recommended.

File:
1 edited

Legend:

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

    r8789 r8833  
    3838    }
    3939
    40     OutputStream::OutputStream(OutputLevel level, OutputContext context)
     40    OutputStream::OutputStream(OutputLevel level, const OutputContextContainer& context)
    4141    {
    4242        this->setOutputAttributes(level, context);
     
    4545    void OutputStream::sendMessage()
    4646    {
    47         OutputManager::getInstanceAndCreateListeners().pushMessage(this->level_, this->context_, this->str());
     47        OutputManager::getInstanceAndCreateListeners().pushMessage(this->level_, *this->context_, this->str());
    4848        this->str("");
    4949    }
    5050
    51     void OutputStream::setOutputAttributes(OutputLevel level, OutputContext context)
     51    void OutputStream::setOutputAttributes(OutputLevel level, const OutputContextContainer& context)
    5252    {
    5353        this->level_ = level;
    54         this->context_ = context;
     54        this->context_ = &context;
    5555
    5656        this->bAcceptsOutput_ = OutputManager::getInstanceAndCreateListeners().acceptsOutput(level, context);
Note: See TracChangeset for help on using the changeset viewer.