Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8778 for code/branches


Ignore:
Timestamp:
Jul 25, 2011, 3:00:29 PM (13 years ago)
Author:
landauf
Message:

guess we can afford a small macro in this case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/util/output/OutputDefinitions.h

    r8777 r8778  
    3232#include "util/UtilPrereqs.h"
    3333#include <string>
     34
     35#define REGISTER_OUTPUT_CONTEXT(name) \
     36    OutputContext name() { static OutputContext value = registerContext(#name); return value; }
    3437
    3538namespace orxonox
     
    6972        namespace
    7073        {
    71             OutputContext undefined()   { static OutputContext value = registerContext("undefined");    return value; }
     74            REGISTER_OUTPUT_CONTEXT(undefined);
    7275
    73             OutputContext test1()       { static OutputContext value = registerContext("test1");        return value; }
    74             OutputContext test2()       { static OutputContext value = registerContext("test2");        return value; }
    75             OutputContext output()      { static OutputContext value = registerContext("output");       return value; }
     76            REGISTER_OUTPUT_CONTEXT(test1);
     77            REGISTER_OUTPUT_CONTEXT(test2);
     78            REGISTER_OUTPUT_CONTEXT(output);
    7679        }
    7780    }
Note: See TracChangeset for help on using the changeset viewer.