Orxonox: src/core/ConfigValueIncludes.h File Reference

# ConfigValueIncludes.h File Reference

Definition of macros for config-values. More...

`#include "CorePrereqs.h"`
`#include "Identifier.h"`
`#include "ConfigValueContainer.h"`
`#include "ConfigFileManager.h"`

## Defines

#define | ModifyConfigValue(varname, modifier,...)
| Modifies a config-value by using a modifier and some arguments.
#define | ResetConfigValue(varname)
| Sets the variable and the config-file entry back to the previously defined default-value.
#define | SetConfigValue(varname, defvalue) SetConfigValueGeneric(ConfigFileType::Settings, varname, defvalue)
#define | SetConfigValueGeneric(type, varname, defvalue)
| Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
#define | SetConfigValueVector(varname, defvalue) SetConfigValueVectorGeneric(ConfigFileType::Settings, varname, defvalue)
#define | SetConfigValueVectorGeneric(type, varname, defvalue)
| Assigns the vector-values, defined in the config-file, to the vector (or the default-value, if there are no entries in the file).

## Detailed Description

Definition of macros for config-values.

## Define Documentation

#define ModifyConfigValue | ( | varname,
|  | modifier,
|  | ... |  | ) |

Value:

    orxonox::ConfigValueContainer* container##varname##modify##modifier = this->getIdentifier()->getConfigValueContainer(#varname); \
        if (container##varname##modify##modifier) \
        { \
            container##varname##modify##modifier->modifier(__VA_ARGS__); \
            container##varname##modify##modifier->getValue(&varname, this); \
        } \
        else \
        { \
            COUT(2) << "Warning: Couln't modify config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
        }

Modifies a config-value by using a modifier and some arguments.

Parameters:

  | varname | The name of the config-value
  | modifier | The name of the modifier: set, tset, add, remove, reset, update

Referenced by orxonox::Shell::addToHistory(), orxonox::Shell::commandHistoryLengthChanged(), orxonox::GraphicsManager::declareResources(), orxonox::GraphicsManager::setupOgre(), and orxonox::CoreConfiguration::tsetMediaPath().

#define ResetConfigValue | ( | varname |  | ) |

Value:

    orxonox::ConfigValueContainer* container##varname##reset = this->getIdentifier()->getConfigValueContainer(#varname); \
        if (container##varname##reset) \
        { \
            container##varname##reset->reset(); \
            container##varname##reset->getValue(&varname, this); \
        } \
        else \
        { \
            COUT(2) << "Warning: Couldn't reset config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
        }

Sets the variable and the config-file entry back to the previously defined default-value.

Parameters:

  | varname | The name of the variable

Referenced by orxonox::CoreConfiguration::resetLanguage(), and orxonox::InputBuffer::setConfigValues().

#define SetConfigValue | ( | varname,
|  | defvalue |  | ) | SetConfigValueGeneric(ConfigFileType::Settings, varname, defvalue)

Referenced by orxonox::SoundMainMenu::setConfigValues(), orxonox::Stats::setConfigValues(), orxonox::ChatOverlay::setConfigValues(), orxonox::InGameConsole::setConfigValues(), orxonox::Spectator::setConfigValues(), orxonox::SpaceShip::setConfigValues(), orxonox::ControllableEntity::setConfigValues(), orxonox::Camera::setConfigValues(), orxonox::Projectile::setConfigValues(), orxonox::Test::setConfigValues(), orxonox::Engine::setConfigValues(), orxonox::HumanPlayer::setConfigValues(), orxonox::UnderAttack::setConfigValues(), orxonox::TeamDeathmatch::setConfigValues(), orxonox::Gametype::setConfigValues(), orxonox::PongAI::setConfigValues(), orxonox::GraphicsManager::setConfigValues(), orxonox::GSLevel::setConfigValues(), orxonox::TrafficControl::setConfigValues(), orxonox::KeyBinder::setConfigValues(), orxonox::InputManager::setConfigValues(), orxonox::InputBuffer::setConfigValues(), orxonox::GameConfiguration::setConfigValues(), and orxonox::CoreConfiguration::setConfigValues().

#define SetConfigValueGeneric | ( | type,
|  | varname,
|  | defvalue |  | ) |

Value:

    static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
        orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
        if (!container##varname) \
        { \
            container##varname = new orxonox::ConfigValueContainer(type, identifier##varname, identifier##varname->getName(), #varname, defvalue, varname); \
            identifier##varname->addConfigValueContainer(#varname, container##varname); \
        } \
        container##varname->getValue(&varname, this)

Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).

Parameters:

  | varname | The name of the variable
  | defvalue | The default-value of the variable

Referenced by orxonox::Shell::setConfigValues().

#define SetConfigValueVector | ( | varname,
|  | defvalue |  | ) | SetConfigValueVectorGeneric(ConfigFileType::Settings, varname, defvalue)

Referenced by orxonox::Bot::setConfigValues(), and orxonox::TeamDeathmatch::setConfigValues().

#define SetConfigValueVectorGeneric | ( | type,
|  | varname,
|  | defvalue |  | ) |

Value:

    static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
        orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
        if (!container##varname) \
        { \
            container##varname = new orxonox::ConfigValueContainer(type, identifier##varname, identifier##varname->getName(), #varname, defvalue); \
            identifier##varname->addConfigValueContainer(#varname, container##varname); \
        } \
        container##varname->getValue(&varname, this)

Assigns the vector-values, defined in the config-file, to the vector (or the default-value, if there are no entries in the file).

Parameters:

  | varname | The name of the std::vector
  | defvalue | The default-value

Referenced by orxonox::Shell::setConfigValues().