Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

documented the remaining code of the output system
created a build unit for the output system

File:
1 edited

Legend:

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

    r8850 r8853  
    2727 */
    2828
     29/**
     30    @file
     31    @brief Implementation of the BaseWriter class.
     32*/
     33
    2934#include "BaseWriter.h"
    3035
     
    3338namespace orxonox
    3439{
     40    /**
     41        @brief Constructor: Initializes the config-values.
     42    */
    3543    BaseWriter::BaseWriter(const std::string& name, bool bRegister) : SubcontextOutputListener(bRegister)
    3644    {
     
    4654    }
    4755
     56    /**
     57        @brief Destructor.
     58    */
    4859    BaseWriter::~BaseWriter()
    4960    {
    5061    }
    5162
     63    /**
     64        @brief This function is inherited from OutputListener, each message is split into lines and sent to printLine().
     65    */
    5266    void BaseWriter::output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines)
    5367    {
     
    5973    }
    6074
     75    /**
     76        @brief Overwritten implementation of the function inherited from OutputListener, sets also the corresponding config-value.
     77    */
    6178    void BaseWriter::setLevelMax(OutputLevel max)
    6279    {
     
    6582    }
    6683
     84    /**
     85        @brief Overwritten implementation of the function inherited from OutputListener, sets also the corresponding config-value.
     86    */
    6787    void BaseWriter::setAdditionalContextsLevelMax(OutputLevel max)
    6888    {
     
    7191    }
    7292
     93    /**
     94        @brief Called if the config value has changed, updates the corresponding mask in OutputListener.
     95    */
    7396    void BaseWriter::changedConfigurableLevel()
    7497    {
     
    7699    }
    77100
     101    /**
     102        @brief Called if the config value has changed, updates the corresponding mask in OutputListener.
     103    */
    78104    void BaseWriter::changedConfigurableAdditionalContextsLevel()
    79105    {
     
    81107    }
    82108
     109    /**
     110        @brief Called if the config-vector of accepted contexts has changed, updates the masks in SubcontextOutputListener.
     111    */
    83112    void BaseWriter::changedConfigurableAdditionalContexts()
    84113    {
     
    86115        std::set<const OutputContextContainer*> sub_contexts;
    87116
     117        // iterate over all strings in the config-vector
    88118        for (size_t i = 0; i < this->configurableAdditionalContexts_.size(); ++i)
    89119        {
    90120            const std::string& full_name = this->configurableAdditionalContexts_[i];
    91121
     122            // split the name into main-name and sub-name (if given; otherwise sub-name remains empty). both names are separated by ::
    92123            std::string name = full_name;
    93124            std::string subname;
     
    100131            }
    101132
     133            // get the context defined by this name
    102134            const OutputContextContainer& context = OutputManager::getInstance().registerContext(name, subname);
    103135
     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.
    104137            if (context.sub_id == context::no_subcontext)
    105138                main_contexts |= context.mask;
     
    108141        }
    109142
     143        // pass main-contexts and sub-contexts to SubcontextOutputListener
    110144        this->setAdditionalContextsMask(main_contexts);
    111145        this->setAdditionalSubcontexts(sub_contexts);
Note: See TracChangeset for help on using the changeset viewer.