Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 3:42:49 AM (16 years ago)
Author:
landauf
Message:

merged core2 back to trunk
there might be some errors, wasn't able to test it yet due to some strange g++ and linker behaviour.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/core/CoreIncludes.h

    r871 r1052  
    2828/**
    2929    @file CoreIncludes.h
    30     @brief Definition of macros and typedefs.
     30    @brief Definition of macros for Identifier and Factory.
    3131
    3232    Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
     
    4040#define _CoreIncludes_H__
    4141
    42 #include "CorePrereqs.h"
    43 
    44 // All needed header-files
    4542#include "Identifier.h"
    4643#include "ClassManager.h"
    4744#include "Factory.h"
    4845#include "ClassFactory.h"
    49 #include "Iterator.h"
    50 #include "OrxonoxClass.h"
    51 #include "ConfigValueContainer.h"
    5246#include "Debug.h"
    5347
    5448
    55 // All needed macros
    5649/**
    5750    @brief Intern macro, containing the common parts of RegisterObject and RegisterRootObject.
     
    111104    orxonox::Factory::getIdentifier(StringOrInt)
    112105
    113 /**
    114     @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
    115     @param varname The name of the variable
    116     @param defvalue The default-value of the variable
    117 */
    118 #define SetConfigValue(varname, defvalue) \
    119     orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
    120     if (!container##varname) \
    121     { \
    122         container##varname = new orxonox::ConfigValueContainer(this->getIdentifier()->getName(), #varname, varname = defvalue); \
    123         this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
    124     } \
    125     container##varname->getValue(&varname)
    126 
    127 /**
    128     @brief Sets the variable and the config-file entry back to the previously defined default-value.
    129     @param varname The name of the variable
    130 */
    131 #define ResetConfigValue(varname) \
    132     orxonox::ConfigValueContainer* container##varname##reset = this->getIdentifier()->getConfigValueContainer(#varname); \
    133     if (container##varname##reset) \
    134     { \
    135         container##varname##reset->resetConfigValue(); \
    136         container##varname##reset->getValue(&varname); \
    137     } \
    138     else \
    139         COUT(2) << "Warning: Couldn't reset variable " << #varname << ", corresponding container doesn't exist." << std::endl
    140 
    141106#endif /* _CoreIncludes_H__ */
Note: See TracChangeset for help on using the changeset viewer.