Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1747 for code


Ignore:
Timestamp:
Sep 9, 2008, 4:25:52 AM (16 years ago)
Author:
landauf
Message:

merged core3 back to trunk

Location:
code/trunk
Files:
15 deleted
121 edited
15 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/audio/AudioIncludes.h

    r1505 r1747  
    4747#include <vorbis/vorbisfile.h>
    4848
    49 #include "core/Error.h"
     49#include "util/Error.h"
  • code/trunk/src/audio/AudioManager.cc

    r1639 r1747  
    3636#include "AudioSource.h"
    3737#include "AudioStream.h"
    38 #include "core/Error.h"
    39 #include "core/Debug.h"
     38#include "util/Error.h"
     39#include "util/Debug.h"
    4040
    4141namespace audio
  • code/trunk/src/audio/AudioManager.h

    r1535 r1747  
    5858                void setOri(std::vector<float> at, std::vector<float> up);
    5959
    60                 // Parses given xml string
    61                 void loadParams();
    62 
    6360                // Update
    6461                void tick(float dt);
  • code/trunk/src/audio/AudioStream.cc

    r1505 r1747  
    2828#include "AudioStream.h"
    2929
    30 #include "core/Debug.h"
    31 #include "core/Error.h"
     30#include "util/Debug.h"
     31#include "util/Error.h"
    3232
    3333namespace audio
  • code/trunk/src/core/BaseObject.h

    r1625 r1747  
    3939#include "CorePrereqs.h"
    4040
     41#include "Super.h"
     42#include "OrxonoxClass.h"
    4143#include "util/XMLIncludes.h"
    42 #include "OrxonoxClass.h"
    4344
    4445namespace orxonox
     
    101102            Namespace* namespace_;
    102103    };
     104
     105    SUPER_FUNCTION(0, BaseObject, XMLPort, false);
     106    SUPER_FUNCTION(2, BaseObject, changedActivity, false);
     107    SUPER_FUNCTION(3, BaseObject, changedVisibility, false);
    103108}
    104109
  • code/trunk/src/core/CMakeLists.txt

    r1612 r1747  
    33  ConfigValueContainer.cc
    44  Core.cc
    5   Error.cc
    65  Language.cc
     6  ObjectListBase.cc
    77  OrxonoxClass.cc
    8   OutputBuffer.cc
    9   OutputHandler.cc
    108  Script.cc
    11   SignalHandler.cc
    129
    1310  # command
  • code/trunk/src/core/ClassFactory.h

    r1543 r1747  
    4343#include "Factory.h"
    4444#include "Identifier.h"
    45 #include "Debug.h"
     45#include "util/Debug.h"
    4646
    4747namespace orxonox
     
    7474    {
    7575        COUT(4) << "*** ClassFactory: Create entry for " << name << " in Factory." << std::endl;
    76         ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>);
     76        ClassIdentifier<T>::getIdentifier(name)->addFactory(new ClassFactory<T>);
    7777        Factory::add(name, ClassIdentifier<T>::getIdentifier());
    7878
  • code/trunk/src/core/ClassTreeMask.h

    r1505 r1747  
    7878namespace orxonox
    7979{
    80     // ###############################
    81     // ###    ClassTreeMaskNode    ###
    82     // ###############################
     80    // ###################################
     81    // ###      ClassTreeMaskNode      ###
     82    // ###################################
    8383    //! The ClassTreeMaskNode is a node in the internal tree of the ClassTreeMask, containing the rules of the mask.
    8484    /**
     
    116116
    117117
    118     // ###############################
    119     // ###  ClassTreeMaskIterator  ###
    120     // ###############################
     118    // ###################################
     119    // ###    ClassTreeMaskIterator    ###
     120    // ###################################
    121121    //! The ClassTreeMaskIterator moves through all ClassTreeMaskNodes of the internal tree of a ClassTreeMask, containing the rules.
    122122    /**
     
    146146
    147147
    148     // ###############################
    149     // ###      ClassTreeMask      ###
    150     // ###############################
     148    // ###################################
     149    // ###        ClassTreeMask        ###
     150    // ###################################
    151151    //! The ClassTreeMask is a set of rules, containing the information for each class whether it's included or not.
    152152    /**
     
    214214            ClassTreeMaskNode* root_;   //!< The root-node of the internal rule-tree, usually BaseObject
    215215    };
     216
     217
     218    // ###################################
     219    // ### ClassTreeMaskObjectIterator ###
     220    // ###################################
     221    //! ...
     222    /**
     223        ...
     224    */
     225    class _CoreExport ClassTreeMaskObjectIterator
     226    {
     227    };
    216228}
    217229
  • code/trunk/src/core/CommandEvaluation.cc

    r1563 r1747  
    3030#include "ConsoleCommand.h"
    3131#include "Identifier.h"
    32 #include "Debug.h"
     32#include "util/Debug.h"
    3333#include "util/String.h"
    3434
     
    218218    }
    219219
    220     void CommandEvaluation::setEvaluatedParameter(unsigned int index, MultiTypeMath param)
     220    void CommandEvaluation::setEvaluatedParameter(unsigned int index, MultiType param)
    221221    {
    222222        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
     
    224224    }
    225225
    226     MultiTypeMath CommandEvaluation::getEvaluatedParameter(unsigned int index) const
     226    MultiType CommandEvaluation::getEvaluatedParameter(unsigned int index) const
    227227    {
    228228        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
     
    240240    }
    241241
    242     MultiTypeMath CommandEvaluation::getReturnvalue() const
     242    MultiType CommandEvaluation::getReturnvalue() const
    243243    {
    244244        if (this->function_)
    245245            return this->function_->getReturnvalue();
    246246
    247         return MultiTypeMath();
     247        return MultiType();
    248248    }
    249249
     
    304304
    305305            if (command->defaultValueSet(i))
    306                 output += "=" + command->getDefaultValue(i).toString() + "]";
     306                output += "=" + command->getDefaultValue(i).getString() + "]";
    307307            else
    308308                output += "}";
  • code/trunk/src/core/CommandEvaluation.h

    r1505 r1747  
    3737#include "ArgumentCompletionListElement.h"
    3838#include "util/SubString.h"
    39 #include "util/MultiTypeMath.h"
     39#include "util/MultiType.h"
    4040
    4141namespace orxonox
     
    8181                { return (this->additionalParameter_ != "") ? (" " + this->additionalParameter_) : ""; }
    8282
    83             void setEvaluatedParameter(unsigned int index, MultiTypeMath param);
    84             MultiTypeMath getEvaluatedParameter(unsigned int index) const;
     83            void setEvaluatedParameter(unsigned int index, MultiType param);
     84            MultiType getEvaluatedParameter(unsigned int index) const;
    8585
    8686            bool hasReturnvalue() const;
    87             MultiTypeMath getReturnvalue() const;
     87            MultiType getReturnvalue() const;
    8888
    8989        private:
     
    115115
    116116            bool bEvaluatedParams_;
    117             MultiTypeMath param_[5];
     117            MultiType param_[5];
    118118    };
    119119}
  • code/trunk/src/core/CommandExecutor.cc

    r1505 r1747  
    3131#include "util/String.h"
    3232#include "util/Convert.h"
     33#include "util/Debug.h"
    3334#include "Identifier.h"
    3435#include "Language.h"
    35 #include "Debug.h"
    3636#include "TclBind.h"
    3737
  • code/trunk/src/core/ConfigFileManager.cc

    r1543 r1747  
    3838namespace orxonox
    3939{
    40     SetConsoleCommandShortcutExtern(config).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());
    41     SetConsoleCommandShortcutExtern(tconfig).setArgumentCompleter(0, autocompletion::configvalueclasses()).setArgumentCompleter(1, autocompletion::configvalues()).setArgumentCompleter(2, autocompletion::configvalue());
     40    SetConsoleCommandShortcutExtern(config).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue());
     41    SetConsoleCommandShortcutExtern(tconfig).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue());
    4242    SetConsoleCommandShortcutExtern(reloadConfig);
    4343    SetConsoleCommandShortcutExtern(cleanConfig);
    44     SetConsoleCommandShortcutExtern(loadSettings).setArgumentCompleter(0, autocompletion::files());
    45     SetConsoleCommandShortcutExtern(loadKeybindings).setArgumentCompleter(0, autocompletion::files());
     44    SetConsoleCommandShortcutExtern(loadSettings).argumentCompleter(0, autocompletion::files());
     45    SetConsoleCommandShortcutExtern(loadKeybindings).argumentCompleter(0, autocompletion::files());
    4646
    4747    bool config(const std::string& classname, const std::string& varname, const std::string& value)
     
    7171    void reloadConfig()
    7272    {
    73         ConfigFileManager::getSingleton()->load();
     73        ConfigFileManager::getInstance()->load();
    7474    }
    7575
    7676    void cleanConfig()
    7777    {
    78         ConfigFileManager::getSingleton()->clean(false);
     78        ConfigFileManager::getInstance()->clean(false);
    7979    }
    8080
    8181    void loadSettings(const std::string& filename)
    8282    {
    83         ConfigFileManager::getSingleton()->setFile(CFT_Settings, filename, false);
     83        ConfigFileManager::getInstance()->setFile(CFT_Settings, filename, false);
    8484    }
    8585
    8686    void loadKeybindings(const std::string& filename)
    8787    {
    88         ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, filename);
     88        ConfigFileManager::getInstance()->setFile(CFT_Keybindings, filename);
    8989    }
    9090
     
    327327        file.close();
    328328
    329         COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
     329        COUT(0) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
    330330
    331331        // Save the file in case something changed (like stripped whitespaces)
     
    459459    }
    460460
    461     ConfigFileManager* ConfigFileManager::getSingleton()
     461    ConfigFileManager* ConfigFileManager::getInstance()
    462462    {
    463463        static ConfigFileManager instance;
  • code/trunk/src/core/ConfigFileManager.h

    r1505 r1747  
    258258    {
    259259        public:
    260             static ConfigFileManager* getSingleton();
     260            static ConfigFileManager* getInstance();
    261261
    262262            void setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting = true);
  • code/trunk/src/core/ConfigValueContainer.cc

    r1505 r1747  
    4747{
    4848    /**
    49         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    50         @param type The type of the corresponding config-file
    51         @param identifier The identifier of the class the variable belongs to
    52         @param varname The name of the variable
    53         @param defvalue The default-value
    54     */
    55     ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue)
     49        @brief Initializes the ConfigValueContainer with defaultvalues.
     50    */
     51    void ConfigValueContainer::init(ConfigFileType type, Identifier* identifier, const std::string& varname)
    5652    {
    5753        this->type_ = type;
     
    5955        this->sectionname_ = identifier->getName();
    6056        this->varname_ = varname;
    61 
     57        this->callback_ = 0;
     58        this->bContainerIsNew_ = true;
     59        this->bDoInitialCallback_ = false;
     60        this->bAddedDescription_ = false;
     61    }
     62
     63    /**
     64        @brief Does some special initialization for single config-values.
     65    */
     66    void ConfigValueContainer::initValue(const MultiType& defvalue)
     67    {
    6268        this->value_ = defvalue;
    63         this->bAddedDescription_ = false;
    6469        this->bIsVector_ = false;
    6570
    66         this->defvalueString_ = defvalue.toString();
     71        this->defvalueString_ = this->value_.getString();
    6772        this->update();
    6873    }
    6974
    7075    /**
    71         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    72         @param type The type of the corresponding config-file
    73         @param identifier The identifier of the class the variable belongs to
    74         @param varname The name of the variable
    75         @param defvalue The default-value
    76     */
    77     ConfigValueContainer::ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue)
    78     {
    79         this->type_ = type;
    80         this->identifier_ = identifier;
    81         this->sectionname_ = identifier->getName();
    82         this->varname_ = varname;
    83 
    84         this->valueVector_ = defvalue;
    85         this->bAddedDescription_ = false;
     76        @brief Does some special initialization for vector config-values.
     77    */
     78    void ConfigValueContainer::initVector()
     79    {
    8680        this->bIsVector_ = true;
    8781
    88         if (defvalue.size() > 0)
    89         {
    90                 this->value_ = defvalue[0];
    91 
    92             for (unsigned int i = 0; i < defvalue.size(); i++)
    93             {
    94                 ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string));
    95                 this->defvalueStringVector_.push_back(defvalue[i].toString());
    96             }
    97 
    98             this->update();
    99         }
     82        for (unsigned int i = 0; i < this->valueVector_.size(); i++)
     83        {
     84            ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string));
     85            this->defvalueStringVector_.push_back(this->valueVector_[i]);
     86        }
     87
     88        this->update();
     89    }
     90
     91    /**
     92        @brief Destructor: Deletes the callback object if necessary.
     93    */
     94    ConfigValueContainer::~ConfigValueContainer()
     95    {
     96        if (this->callback_)
     97            delete this->callback_;
    10098    }
    10199
     
    105103        @return True if the new value was successfully assigned
    106104    */
    107     bool ConfigValueContainer::set(const MultiTypeMath& input)
    108     {
    109         if (this->bIsVector_)
    110         {
    111             return this->callFunctionWithIndex(&ConfigValueContainer::set, input.toString());
     105    bool ConfigValueContainer::set(const MultiType& input)
     106    {
     107        if (this->bIsVector_)
     108        {
     109            return this->callFunctionWithIndex(&ConfigValueContainer::set, input);
    112110        }
    113111        else
     
    115113            if (this->tset(input))
    116114            {
    117                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input.toString(), this->value_.isA(MT_string));
     115                ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isType(MT_string));
    118116                return true;
    119117            }
     
    128126        @return True if the new value was successfully assigned
    129127    */
    130     bool ConfigValueContainer::set(unsigned int index, const MultiTypeMath& input)
     128    bool ConfigValueContainer::set(unsigned int index, const MultiType& input)
    131129    {
    132130        if (this->bIsVector_)
     
    134132            if (this->tset(index, input))
    135133            {
    136                 ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input.toString(), this->value_.isA(MT_string));
     134                ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isType(MT_string));
    137135                return true;
    138136            }
     
    150148        @return True if the new value was successfully assigned
    151149    */
    152     bool ConfigValueContainer::tset(const MultiTypeMath& input)
    153     {
    154         if (this->bIsVector_)
    155         {
    156             return this->callFunctionWithIndex(&ConfigValueContainer::tset, input.toString());
    157         }
    158         else
    159         {
    160             MultiTypeMath temp = this->value_;
    161             if (temp.assimilate(input))
    162             {
    163                 this->value_ = temp;
    164                 if (this->identifier_)
    165                     this->identifier_->updateConfigValues();
    166 
    167                 return true;
    168             }
    169         }
    170         return false;
     150    bool ConfigValueContainer::tset(const MultiType& input)
     151    {
     152        if (this->bIsVector_)
     153        {
     154            return this->callFunctionWithIndex(&ConfigValueContainer::tset, input);
     155            return false;
     156        }
     157        else
     158        {
     159            this->value_ = input;
     160
     161            if (this->identifier_)
     162                this->identifier_->updateConfigValues();
     163
     164            return true;
     165        }
    171166    }
    172167
     
    177172        @return True if the new value was successfully assigned
    178173    */
    179     bool ConfigValueContainer::tset(unsigned int index, const MultiTypeMath& input)
     174    bool ConfigValueContainer::tset(unsigned int index, const MultiType& input)
    180175    {
    181176        if (this->bIsVector_)
     
    191186                for (unsigned int i = this->valueVector_.size(); i <= index; i++)
    192187                {
    193                     this->valueVector_.push_back(MultiTypeMath());
     188                    this->valueVector_.push_back(MultiType());
    194189                }
    195190            }
    196191
    197             MultiTypeMath temp = this->value_;
    198             if (temp.assimilate(input))
    199             {
    200                 this->valueVector_[index] = temp;
    201 
    202                 if (this->identifier_)
    203                     this->identifier_->updateConfigValues();
    204 
    205                 return true;
    206             }
     192            this->valueVector_[index] = input;
     193
     194            if (this->identifier_)
     195                this->identifier_->updateConfigValues();
     196
     197            return true;
    207198        }
    208199        else
    209200        {
    210201            COUT(1) << "Error: Config-value '" << this->varname_ << "' in " << this->sectionname_ << " is not a vector." << std::endl;
    211         }
    212         return false;
     202            return false;
     203        }
    213204    }
    214205
     
    218209        @return True if the new entry was successfully added
    219210    */
    220     bool ConfigValueContainer::add(const MultiTypeMath& input)
     211    bool ConfigValueContainer::add(const MultiType& input)
    221212    {
    222213        if (this->bIsVector_)
     
    241232                this->valueVector_.erase(this->valueVector_.begin() + index);
    242233                for (unsigned int i = index; i < this->valueVector_.size(); i++)
    243                     ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
    244                 ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
     234                    ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string));
     235                ConfigFileManager::getInstance()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
    245236
    246237                return true;
     
    266257                if (!this->set(i, this->defvalueStringVector_[i]))
    267258                    success = false;
    268             ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->defvalueStringVector_.size());
     259            ConfigFileManager::getInstance()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->defvalueStringVector_.size());
    269260            return success;
    270261        }
     
    277268    {
    278269        if (!this->bIsVector_)
    279             this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));
     270            this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType(MT_string));
    280271        else
    281272        {
    282273            this->valueVector_.clear();
    283             for (unsigned int i = 0; i < ConfigFileManager::getSingleton()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
     274            for (unsigned int i = 0; i < ConfigFileManager::getInstance()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
    284275            {
    285276                if (i < this->defvalueStringVector_.size())
    286277                {
    287                     this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));
     278                    this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType(MT_string));
    288279                }
    289280                else
    290281                {
    291                     this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiTypeMath(), this->value_.isA(MT_string)));
     282                    this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiType(), this->value_.isType(MT_string));
    292283                }
    293284
     
    303294        @return The returnvalue of the functioncall
    304295    */
    305     bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiTypeMath&), const std::string& input)
     296    bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input)
    306297    {
    307298        SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '(', ')', false, '\0');
     
    335326        @param description The description
    336327    */
    337     void ConfigValueContainer::description(const std::string& description)
     328    ConfigValueContainer& ConfigValueContainer::description(const std::string& description)
    338329    {
    339330        if (!this->bAddedDescription_)
     
    343334            this->bAddedDescription_ = true;
    344335        }
     336        return (*this);
    345337    }
    346338
  • code/trunk/src/core/ConfigValueContainer.h

    r1505 r1747  
    5050
    5151#include "util/Math.h"
    52 #include "util/MultiTypeMath.h"
     52#include "util/MultiType.h"
    5353#include "ConfigFileManager.h"
    5454
    5555namespace orxonox
    5656{
     57    class ConfigValueCallbackBase
     58    {
     59        public:
     60            virtual void call(void* object) = 0;
     61            inline virtual ~ConfigValueCallbackBase() {}
     62    };
     63
     64    template <class T>
     65    class ConfigValueCallback: public ConfigValueCallbackBase
     66    {
     67        public:
     68            inline ConfigValueCallback(void (T::*function) (void)) : function_(function) {}
     69            inline virtual ~ConfigValueCallback() {}
     70            inline virtual void call(void* object)
     71                { (((T*)object)->*this->function_)(); }
     72
     73        private:
     74            void (T::*function_) (void);
     75    };
     76
     77
    5778    //! The ConfigValuecontainer contains all needed informations about a configurable variable.
    5879    /**
     
    7495    {
    7596        public:
    76             ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const MultiTypeMath& defvalue);
    77             ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<MultiTypeMath>& defvalue);
    78 
    79             /** @brief Returns the configured value. @param value This is only needed to determine the right type. @return The value */
    80             template <typename T>
    81             inline ConfigValueContainer& getValue(T* value)
    82                 { this->value_.getValue(value); return *this; }
    83             template <typename T>
    84             inline ConfigValueContainer& getValue(std::vector<T>* value)
    85             {
    86                 value->clear();
    87                 for (unsigned int i = 0; i < this->valueVector_.size(); i++)
    88                     value->push_back(this->valueVector_[i]);
     97            /**
     98                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     99                @param type The type of the corresponding config-file
     100                @param identifier The identifier of the class the variable belongs to
     101                @param varname The name of the variable
     102                @param defvalue The default-value
     103                @param value Only needed do determine the right type.
     104            */
     105            template <class D, class V>
     106            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const D& defvalue, const V& value)
     107            {
     108                this->init(type, identifier, varname);
     109                this->initValue((V)defvalue);
     110            }
     111
     112            /**
     113                @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     114                @param type The type of the corresponding config-file
     115                @param identifier The identifier of the class the variable belongs to
     116                @param varname The name of the variable
     117                @param defvalue The default-value
     118            */
     119            template <class V>
     120            ConfigValueContainer(ConfigFileType type, Identifier* identifier, const std::string& varname, const std::vector<V>& defvalue)
     121            {
     122                this->init(type, identifier, varname);
     123
     124                this->value_ = V();
     125                for (unsigned int i = 0; i < defvalue.size(); i++)
     126                    this->valueVector_.push_back(MultiType(defvalue[i]));
     127
     128                this->initVector();
     129            }
     130
     131            ~ConfigValueContainer();
     132
     133            /**
     134                @brief Returns the configured value.
     135                @param value A pointer to the variable to store the value.
     136                @param object The object calling this function
     137                @return The ConfigValueContainer
     138            */
     139            template <typename T, class C>
     140            ConfigValueContainer& getValue(T* value, C* object)
     141            {
     142                if ((this->callback_ && object) || this->bContainerIsNew_)
     143                {
     144                    if (this->bContainerIsNew_)
     145                        this->bContainerIsNew_ = false;
     146
     147                    T temp = *value;
     148                    this->value_.getValue(value);
     149                    if ((*value) != temp)
     150                    {
     151                        if (this->callback_ && object)
     152                            this->callback_->call(object);
     153                        else
     154                            this->bDoInitialCallback_ = true;
     155                    }
     156                }
     157                else
     158                {
     159                    this->value_.getValue(value);
     160                }
    89161                return *this;
    90162            }
    91163
    92             template <typename T>
    93             inline void setVectorType(const std::vector<T>& value)
    94             {
    95                 this->value_ = T();
    96                 this->update();
    97             }
    98 
     164            /**
     165                @brief Returns the configured vector.
     166                @param value A pointer to the vector to store the values.
     167                @param object The object calling this function
     168                @return The ConfigValueContainer
     169            */
     170            template <typename T, class C>
     171            ConfigValueContainer& getValue(std::vector<T>* value, C* object)
     172            {
     173                if ((this->callback_ && object) || this->bContainerIsNew_)
     174                {
     175                    if (this->bContainerIsNew_)
     176                        this->bContainerIsNew_ = false;
     177
     178                    std::vector<T> temp = *value;
     179                    value->clear();
     180                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
     181                        value->push_back(this->valueVector_[i]);
     182
     183                    if (value->size() != temp.size())
     184                    {
     185                        if (this->callback_ && object)
     186                            this->callback_->call(object);
     187                        else
     188                            this->bDoInitialCallback_ = true;
     189                    }
     190                    else
     191                    {
     192                        for (unsigned int i = 0; i < value->size(); ++i)
     193                        {
     194                            if ((*value)[i] != temp[i])
     195                            {
     196                                if (this->callback_ && object)
     197                                    this->callback_->call(object);
     198                                else
     199                                    this->bDoInitialCallback_ = true;
     200                                break;
     201                            }
     202                        }
     203                    }
     204                }
     205                else
     206                {
     207                    value->clear();
     208                    for (unsigned int i = 0; i < this->valueVector_.size(); ++i)
     209                        value->push_back(this->valueVector_[i]);
     210                }
     211                return *this;
     212            }
     213
     214            /** @brief Returns the name of this container. */
    99215            inline const std::string& getName() const
    100216                { return this->varname_; }
     217            /** @brief Returns true if this config-value is a vector */
    101218            inline bool isVector() const
    102219                { return this->bIsVector_; }
     220            /** @brief Returns the vectors size (or zero if it's not a vector). */
    103221            inline unsigned int getVectorSize() const
    104222                { return this->valueVector_.size(); }
    105223
    106             void description(const std::string& description);
     224            ConfigValueContainer& description(const std::string& description);
    107225            const std::string& getDescription() const;
    108226
    109             bool set(const MultiTypeMath& input);
    110             bool tset(const MultiTypeMath& input);
    111 
    112             bool set(unsigned int index, const MultiTypeMath& input);
    113             bool tset(unsigned int index, const MultiTypeMath& input);
    114             bool add(const MultiTypeMath& input);
     227            /**
     228                @brief Adds a callback function, that gets called after getValue() if the newly assigned value differs from the old value of the variable.
     229                @param object The object to call the function
     230                @param function The callback function
     231            */
     232            template <class T>
     233            inline ConfigValueContainer& callback(T* object, void (T::*function) (void))
     234            {
     235                if (!this->callback_)
     236                {
     237                    this->callback_ = new ConfigValueCallback<T>(function);
     238
     239                    if (this->bDoInitialCallback_)
     240                    {
     241                        this->bDoInitialCallback_ = false;
     242                        this->callback_->call(object);
     243                    }
     244                }
     245
     246                return (*this);
     247            }
     248
     249            bool set(const MultiType& input);
     250            bool tset(const MultiType& input);
     251
     252            bool set(unsigned int index, const MultiType& input);
     253            bool tset(unsigned int index, const MultiType& input);
     254            bool add(const MultiType& input);
    115255            bool remove(unsigned int index);
    116256
     
    120260            /** @brief Converts the config-value to a string. @return The string */
    121261            inline std::string toString() const
    122                 { return this->value_.toString(); }
     262                { return this->value_; }
    123263            /** @brief Returns the typename of the assigned config-value. @return The typename */
    124264            inline std::string getTypename() const
     
    126266
    127267        private:
    128             bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiTypeMath&), const std::string& input);
     268            void init(ConfigFileType type, Identifier* identifier, const std::string& varname);
     269            void initValue(const MultiType& defvalue);
     270            void initVector();
     271            bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input);
    129272
    130273            bool                       bIsVector_;                  //!< True if the container contains a std::vector
     
    137280            std::vector<std::string>   defvalueStringVector_;       //!< A vector, containg the strings of the default-values in case we're storing a vector
    138281
    139             MultiTypeMath              value_;                      //!< The value
    140             std::vector<MultiTypeMath> valueVector_;                //!< A vector, containg the values in case we're storing a vector
     282            MultiType                  value_;                      //!< The value
     283            std::vector<MultiType>    valueVector_;                //!< A vector, containg the values in case we're storing a vector
    141284
    142285            bool                       bAddedDescription_;          //!< True if a description was added
    143286            LanguageEntryLabel         description_;                //!< The description
     287            ConfigValueCallbackBase*   callback_;                   //!< A callback function to call after getValue if the value changed
     288
     289            bool                       bContainerIsNew_;            //!< True if it's the first time getValue() gets called
     290            bool                       bDoInitialCallback_;         //!< True if the callback should be called as soon as it gets created
    144291    };
    145292}
  • code/trunk/src/core/ConfigValueIncludes.h

    r1543 r1747  
    4747    @param defvalue The default-value of the variable
    4848*/
    49 #define SetConfigValue(varname, defvalue) \
    50     orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
     49#define SetConfigValueGeneric(type, varname, defvalue) \
     50    static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
     51    orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
    5152    if (!container##varname) \
    5253    { \
    53         container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, varname = defvalue); \
    54         this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
     54        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, defvalue, varname); \
     55        identifier##varname->addConfigValueContainer(#varname, container##varname); \
    5556    } \
    56     container##varname->getValue(&varname)
     57    container##varname->getValue(&varname, this)
    5758
    58 /**
    59     @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
    60     @param classname name in which the config value should be stored
    61     @param varname The name of the variable
    62     @param defvalue The default-value of the variable
    63 */
    64 #define SetConfigValueGeneric(classname, varname, defvalue) \
    65     orxonox::ConfigValueContainer* container##varname = ClassIdentifier<classname>::getIdentifier()->getConfigValueContainer(#varname); \
    66     if (!container##varname) \
    67     { \
    68         container##varname = new orxonox::ConfigValueContainer(CFT_Settings, ClassIdentifier<classname>::getIdentifier(), #varname, varname = defvalue); \
    69         ClassIdentifier<classname>::getIdentifier()->addConfigValueContainer(#varname, container##varname); \
    70     } \
    71     container##varname->getValue(&varname)
     59#define SetConfigValue(varname, defvalue) SetConfigValueGeneric(CFT_Settings, varname, defvalue)
     60#define SetKeybindingValue(varname, defvalue) SetConfigValueGeneric(CFT_Keybindings, varname, defvalue)
     61
    7262
    7363/**
     
    7666    @param defvalue The default-value
    7767*/
    78 #define SetConfigValueVector(varname, defvalue) \
    79     orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \
     68#define SetConfigValueVectorGeneric(type, varname, defvalue) \
     69    static orxonox::Identifier* identifier##varname = this->getIdentifier(); \
     70    orxonox::ConfigValueContainer* container##varname = identifier##varname->getConfigValueContainer(#varname); \
    8071    if (!container##varname) \
    8172    { \
    82         std::vector<MultiTypeMath> temp; \
    83         for (unsigned int i = 0; i < defvalue.size(); i++) \
    84             temp.push_back(MultiTypeMath(defvalue[i])); \
    85         container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, temp); \
    86         container##varname->setVectorType(varname); \
    87         this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
     73        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, #varname, defvalue); \
     74        identifier##varname->addConfigValueContainer(#varname, container##varname); \
    8875    } \
    89     container##varname->getValue(&varname)
     76    container##varname->getValue(&varname, this)
     77
     78#define SetConfigValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Settings, varname, defvalue)
     79#define SetKeybindingValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Keybindings, varname, defvalue)
     80
    9081
    9182/**
     
    9889    { \
    9990        container##varname##reset->reset(); \
    100         container##varname##reset->getValue(&varname); \
     91        container##varname##reset->getValue(&varname, this); \
    10192    } \
    10293    else \
     
    10495        COUT(2) << "Warning: Couldn't reset config-value '" << #varname << "', corresponding container doesn't exist." << std::endl; \
    10596    }
     97
    10698
    10799/**
     
    115107    { \
    116108        container##varname##modify##modifier->modifier(__VA_ARGS__); \
    117         container##varname##modify##modifier->getValue(&varname); \
     109        container##varname##modify##modifier->getValue(&varname, this); \
    118110    } \
    119111    else \
  • code/trunk/src/core/ConsoleCommand.cc

    r1505 r1747  
    4545    }
    4646
    47     ConsoleCommand& ConsoleCommand::setArgumentCompleter(unsigned int param, ArgumentCompleter* completer)
     47    ConsoleCommand& ConsoleCommand::argumentCompleter(unsigned int param, ArgumentCompleter* completer)
    4848    {
    4949        if (param < 5)
  • code/trunk/src/core/ConsoleCommand.h

    r1549 r1747  
    3838
    3939
    40 #define SetConsoleCommand(classname, function,  bCreateShortcut) \
    41     SetConsoleCommandGeneric(classname##function##consolecommand__, classname, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), #function), bCreateShortcut)
     40#define SetConsoleCommand(classname, function, bCreateShortcut) \
     41    SetConsoleCommandAliasMulti(classname, function, #function, 0, bCreateShortcut)
     42#define SetConsoleCommandAlias(classname, function, name, bCreateShortcut) \
     43    SetConsoleCommandAliasMulti(classname, function, name, 0, bCreateShortcut)
     44#define SetConsoleCommandAliasMulti(classname, function, name, number, bCreateShortcut) \
     45    SetConsoleCommandGeneric(classname##function##consolecommand__##number, classname, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name), bCreateShortcut)
    4246
    4347#define SetConsoleCommandGeneric(fakevariable, classname, command, bCreateShortcut) \
    44     orxonox::ConsoleCommand& fakevariable = orxonox::ClassIdentifier<classname>::getIdentifier()->addConsoleCommand(command, bCreateShortcut)
     48    orxonox::ConsoleCommand& fakevariable = orxonox::ClassIdentifier<classname>::getIdentifier(#classname)->addConsoleCommand(command, bCreateShortcut)
    4549
    4650
    4751#define SetConsoleCommandShortcut(classname, function) \
    48     SetConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), #function))
     52    SetConsoleCommandShortcutAliasMulti(classname, function, #function, 0)
     53#define SetConsoleCommandShortcutAlias(classname, function, name) \
     54    SetConsoleCommandShortcutAliasMulti(classname, function, name, 0)
     55#define SetConsoleCommandShortcutAliasMulti(classname, function, name, number) \
     56    SetConsoleCommandShortcutGeneric(function##consolecommand__##number, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), name))
    4957
    5058#define SetConsoleCommandShortcutExtern(function) \
    51     SetConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createConsoleCommand(orxonox::createFunctor(&function), #function))
     59    SetConsoleCommandShortcutExternAliasMulti(function, #function, 0)
     60#define SetConsoleCommandShortcutExternAlias(function, name) \
     61    SetConsoleCommandShortcutExternAliasMulti(function, name, 0)
     62#define SetConsoleCommandShortcutExternAliasMulti(function, name, number) \
     63    SetConsoleCommandShortcutGeneric(function##consolecommand__##number, orxonox::createConsoleCommand(orxonox::createFunctor(&function), name))
    5264
    5365#define SetConsoleCommandShortcutGeneric(fakevariable, command) \
     
    7587            ConsoleCommand(FunctorStatic* functor, const std::string& name = "");
    7688
    77             inline ConsoleCommand& setDescription(const std::string& description)
     89            inline ConsoleCommand& description(const std::string& description)
    7890                { this->ExecutorStatic::setDescription(description); return (*this); }
    79             inline ConsoleCommand& setDescriptionParam(int param, const std::string& description)
     91            inline ConsoleCommand& descriptionParam(int param, const std::string& description)
    8092                { this->ExecutorStatic::setDescriptionParam(param, description); return (*this); }
    81             inline ConsoleCommand& setDescriptionReturnvalue(const std::string& description)
     93            inline ConsoleCommand& descriptionReturnvalue(const std::string& description)
    8294                { this->ExecutorStatic::setDescriptionReturnvalue(description); return (*this); }
    83             inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1)
     95            inline ConsoleCommand& defaultValues(const MultiType& param1)
    8496                { this->ExecutorStatic::setDefaultValues(param1); return (*this); }
    85             inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
     97            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2)
    8698                { this->ExecutorStatic::setDefaultValues(param1, param2); return (*this); }
    87             inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
     99            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
    88100                { this->ExecutorStatic::setDefaultValues(param1, param2, param3); return (*this); }
    89             inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
     101            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
    90102                { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4); return (*this); }
    91             inline ConsoleCommand& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
     103            inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
    92104                { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4, param5); return (*this); }
    93             inline ConsoleCommand& setDefaultValue(unsigned int index, const MultiTypeMath& param)
     105            inline ConsoleCommand& defaultValue(unsigned int index, const MultiType& param)
    94106                { this->ExecutorStatic::setDefaultValue(index, param); return (*this); }
    95107
    96             inline ConsoleCommand& setAccessLevel(AccessLevel::Level level)
     108            inline ConsoleCommand& accessLevel(AccessLevel::Level level)
    97109                { this->accessLevel_ = level; return (*this); }
    98110            inline AccessLevel::Level getAccessLevel() const
    99111                { return this->accessLevel_; }
    100112
    101             ConsoleCommand& setArgumentCompleter(unsigned int param, ArgumentCompleter* completer);
     113            ConsoleCommand& argumentCompleter(unsigned int param, ArgumentCompleter* completer);
    102114            ArgumentCompleter* getArgumentCompleter(unsigned int param) const;
    103115
     
    110122                { return this->argumentList_.end(); }
    111123
    112             inline ConsoleCommand& setKeybindMode(KeybindMode::Enum mode)
     124            inline ConsoleCommand& keybindMode(KeybindMode::Enum mode)
    113125                { this->keybindMode_ = mode; return *this; }
    114126            inline KeybindMode::Enum getKeybindMode() const
    115127                { return this->keybindMode_; }
    116128
    117             inline ConsoleCommand& setAxisParamIndex(int index)
     129            inline ConsoleCommand& axisParamIndex(int index)
    118130                { this->axisParamIndex_ = index; return *this; }
    119131            inline int getAxisParamIndex() const
    120132                { return this->axisParamIndex_; }
    121133
    122             inline ConsoleCommand& setIsAxisRelative(bool val)
     134            inline ConsoleCommand& isAxisRelative(bool val)
    123135                { this->bAxisRelative_ = val; return *this; }
    124136            inline int getIsAxisRelative() const
  • code/trunk/src/core/ConsoleCommandCompilation.cc

    r1505 r1747  
    2929#include "ConsoleCommandCompilation.h"
    3030#include "ConsoleCommand.h"
    31 #include "Debug.h"
     31#include "util/Debug.h"
    3232#include "util/ExprParser.h"
    3333
    3434namespace orxonox
    3535{
    36     SetConsoleCommandShortcutExtern(source).setArgumentCompleter(0, autocompletion::files());
     36    SetConsoleCommandShortcutExtern(source).argumentCompleter(0, autocompletion::files());
    3737    SetConsoleCommandShortcutExtern(echo);
    3838    SetConsoleCommandShortcutExtern(puts);
    3939
    40     SetConsoleCommandShortcutExtern(read).setArgumentCompleter(0, autocompletion::files());
    41     SetConsoleCommandShortcutExtern(append).setArgumentCompleter(0, autocompletion::files());
    42     SetConsoleCommandShortcutExtern(write).setArgumentCompleter(0, autocompletion::files());
     40    SetConsoleCommandShortcutExtern(read).argumentCompleter(0, autocompletion::files());
     41    SetConsoleCommandShortcutExtern(append).argumentCompleter(0, autocompletion::files());
     42    SetConsoleCommandShortcutExtern(write).argumentCompleter(0, autocompletion::files());
    4343
    4444    SetConsoleCommandShortcutExtern(calculate);
  • code/trunk/src/core/Core.cc

    r1535 r1747  
    9696    void Core::setConfigValues()
    9797    {
    98         SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console");
    99         SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile");
    100         SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell");
    101 
     98        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console").callback(this, &Core::debugLevelChanged);
     99        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile").callback(this, &Core::debugLevelChanged);
     100        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged);
     101        SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text").callback(this, &Core::languageChanged);
     102    }
     103
     104    /**
     105        @brief Callback function if the debug level has changed.
     106    */
     107    void Core::debugLevelChanged()
     108    {
    102109        // softDebugLevel_ is the maximum of the 3 variables
    103110        this->softDebugLevel_ = this->softDebugLevelConsole_;
     
    107114            this->softDebugLevel_ = this->softDebugLevelShell_;
    108115
    109 
    110         std::string temp = this->language_;
    111         SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text");
    112 
    113         if (this->language_ != temp)
    114         {
    115             // Read the translation file after the language was configured
    116             Language::getLanguage().readTranslatedLanguageFile();
    117         }
     116        OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
     117        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
     118        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
     119        OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
     120    }
     121
     122    /**
     123        @brief Callback function if the language has changed.
     124    */
     125    void Core::languageChanged()
     126    {
     127        // Read the translation file after the language was configured
     128        Language::getLanguage().readTranslatedLanguageFile();
    118129    }
    119130
     
    158169            else if (device == OutputHandler::LD_Shell)
    159170                Core::getInstance().softDebugLevelShell_ = level;
     171
     172            OutputHandler::setSoftDebugLevel(device, level);
    160173        }
    161174     }
     
    199212    }
    200213}
    201 
    202 /**
    203     @brief Returns the soft debug level, stored in the only existing instance of the DebugLevel class, configured in the config-file.
    204     @return The soft debug level
    205 */
    206 int getSoftDebugLevel()
    207 {
    208     return orxonox::Core::getSoftDebugLevel();
    209 }
  • code/trunk/src/core/Core.h

    r1535 r1747  
    4141
    4242#include "OrxonoxClass.h"
    43 #include "OutputHandler.h"
     43#include "util/OutputHandler.h"
    4444
    4545namespace orxonox
     
    5252            static bool& isCreatingCoreSettings();
    5353            void setConfigValues();
     54            void debugLevelChanged();
     55            void languageChanged();
    5456
    5557            static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
  • code/trunk/src/core/CoreIncludes.h

    r1543 r1747  
    4646#include "Factory.h"
    4747#include "ClassFactory.h"
    48 #include "Debug.h"
     48#include "util/Debug.h"
    4949
    5050
     
    5555*/
    5656#define InternRegisterObject(ClassName, bRootClass) \
    57     this->setIdentifier(orxonox::ClassIdentifier<ClassName>::getIdentifier()->registerClass(this->getParents(), #ClassName, bRootClass)); \
    58     if (orxonox::Identifier::isCreatingHierarchy() && this->getParents()) \
    59         this->getParents()->insert(this->getParents()->end(), this->getIdentifier()); \
    60     orxonox::ClassIdentifier<ClassName>::getIdentifier()->addObject(this); \
     57    this->setIdentifier(orxonox::ClassIdentifier<ClassName>::getIdentifier(#ClassName)); \
    6158    if (orxonox::Identifier::isCreatingHierarchy()) \
    62       return
     59    { \
     60        if (this->getParents()) \
     61        { \
     62            orxonox::ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeClassHierarchy(this->getParents(), bRootClass); \
     63            this->getParents()->insert(this->getParents()->end(), this->getIdentifier()); \
     64        } \
     65        this->setConfigValues(); \
     66        return; \
     67    } \
     68    orxonox::ClassIdentifier<ClassName>::getIdentifier()->addObject(this)
    6369
    6470/**
  • code/trunk/src/core/CorePrereqs.h

    r1543 r1747  
    6262// Forward declarations
    6363//-----------------------------------------------------------------------
    64 class SignalHandler;
    65 
    6664namespace orxonox
    6765{
     
    111109  class ConsoleCommand;
    112110  class Core;
    113   class Error;
    114111  class Executor;
    115112  template <class T>
     
    125122  template <class T>
    126123  class Iterator;
     124  class IteratorBase;
    127125  class Language;
    128126  class LanguageEntry;
     
    130128  class Loader;
    131129  class MetaObjectList;
    132   template <class T>
    133130  class MetaObjectListElement;
    134131  class Namespace;
     
    136133  template <class T>
    137134  class ObjectList;
     135  class ObjectListBase;
     136  class ObjectListBaseElement;
    138137  template <class T>
    139138  class ObjectListElement;
     139  template <class T>
     140  class ObjectListIterator;
    140141  class OrxonoxClass;
    141   class OutputBuffer;
    142   class OutputBufferListener;
    143   class OutputHandler;
    144142  class Shell;
    145143  class ShellListener;
  • code/trunk/src/core/Executor.cc

    r1625 r1747  
    6666    }
    6767
    68     bool Executor::evaluate(const std::string& params, MultiTypeMath param[5], const std::string& delimiter) const
     68    bool Executor::evaluate(const std::string& params, MultiType param[5], const std::string& delimiter) const
    6969    {
    7070        unsigned int paramCount = this->functor_->getParamCount();
     
    172172    }
    173173
    174     Executor& Executor::setDefaultValues(const MultiTypeMath& param1)
    175     {
    176         this->defaultValue_[0] = param1;
    177         this->bAddedDefaultValue_[0] = true;
    178 
    179         return (*this);
    180     }
    181 
    182     Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
    183     {
    184         this->defaultValue_[0] = param1;
    185         this->bAddedDefaultValue_[0] = true;
    186         this->defaultValue_[1] = param2;
    187         this->bAddedDefaultValue_[1] = true;
    188 
    189         return (*this);
    190     }
    191 
    192     Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
     174    Executor& Executor::setDefaultValues(const MultiType& param1)
     175    {
     176        this->defaultValue_[0] = param1;
     177        this->bAddedDefaultValue_[0] = true;
     178
     179        return (*this);
     180    }
     181
     182    Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2)
     183    {
     184        this->defaultValue_[0] = param1;
     185        this->bAddedDefaultValue_[0] = true;
     186        this->defaultValue_[1] = param2;
     187        this->bAddedDefaultValue_[1] = true;
     188
     189        return (*this);
     190    }
     191
     192    Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
    193193    {
    194194        this->defaultValue_[0] = param1;
     
    202202    }
    203203
    204     Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
     204    Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
    205205    {
    206206        this->defaultValue_[0] = param1;
     
    216216    }
    217217
    218     Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
     218    Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
    219219    {
    220220        this->defaultValue_[0] = param1;
     
    232232    }
    233233
    234     Executor& Executor::setDefaultValue(unsigned int index, const MultiTypeMath& param)
     234    Executor& Executor::setDefaultValue(unsigned int index, const MultiType& param)
    235235    {
    236236        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
  • code/trunk/src/core/Executor.h

    r1505 r1747  
    3737#include "util/Math.h"
    3838#include "Functor.h"
    39 #include "Debug.h"
     39#include "util/Debug.h"
    4040
    4141
     
    6464        { \
    6565            COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using whole string: " << params << std::endl; \
    66             EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) MultiTypeMath(params)); \
     66            EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) MultiType(params)); \
    6767        } \
    6868        else if (this->bAddedDefaultValue_[0]) \
     
    9090        } \
    9191        \
    92         MultiTypeMath param[MAX_FUNCTOR_ARGUMENTS]; \
     92        MultiType param[MAX_FUNCTOR_ARGUMENTS]; \
    9393        COUT(5) << "Calling Executor " << this->name_ << " through parser with " << paramCount << " parameters, using " << tokens.size() << " tokens ("; \
    9494        for (unsigned int i = 0; i < tokens.size() && i < MAX_FUNCTOR_ARGUMENTS; i++) \
     
    145145            inline void operator()() const
    146146                { (*this->functor_)(this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    147             inline void operator()(const MultiTypeMath& param1) const
     147            inline void operator()(const MultiType& param1) const
    148148                { (*this->functor_)(param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    149             inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2) const
     149            inline void operator()(const MultiType& param1, const MultiType& param2) const
    150150                { (*this->functor_)(param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    151             inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
     151            inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3) const
    152152                { (*this->functor_)(param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
    153             inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
     153            inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const
    154154                { (*this->functor_)(param1, param2, param3, param4, this->defaultValue_[4]); }
    155             inline void operator()(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
     155            inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const
    156156                { (*this->functor_)(param1, param2, param3, param4, param5); }
    157157
    158158            bool parse(const std::string& params, const std::string& delimiter = " ") const;
    159159
    160             bool evaluate(const std::string& params, MultiTypeMath param[5], const std::string& delimiter = " ") const;
     160            bool evaluate(const std::string& params, MultiType param[5], const std::string& delimiter = " ") const;
    161161
    162162            Executor& setDescription(const std::string& description);
     
    177177            inline FunctionType getType() const
    178178                { return this->functor_->getType(); }
    179             inline MultiTypeMath getReturnvalue() const
     179            inline MultiType getReturnvalue() const
    180180                { return this->functor_->getReturnvalue(); }
    181181            inline std::string getTypenameParam(unsigned int param) const
     
    189189                { return this->name_; }
    190190
    191             Executor& setDefaultValues(const MultiTypeMath& param1);
    192             Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2);
    193             Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3);
    194             Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4);
    195             Executor& setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5);
    196             Executor& setDefaultValue(unsigned int index, const MultiTypeMath& param);
    197 
    198             inline MultiTypeMath getDefaultValue(unsigned int index) const
     191            Executor& setDefaultValues(const MultiType& param1);
     192            Executor& setDefaultValues(const MultiType& param1, const MultiType& param2);
     193            Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3);
     194            Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4);
     195            Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5);
     196            Executor& setDefaultValue(unsigned int index, const MultiType& param);
     197
     198            inline MultiType getDefaultValue(unsigned int index) const
    199199            {
    200200                if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
     
    216216            Functor* functor_;
    217217            std::string name_;
    218             MultiTypeMath defaultValue_[MAX_FUNCTOR_ARGUMENTS];
     218            MultiType defaultValue_[MAX_FUNCTOR_ARGUMENTS];
    219219            bool bAddedDefaultValue_[MAX_FUNCTOR_ARGUMENTS];
    220220
     
    245245            inline void operator()(T* object) const
    246246                { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    247             inline void operator()(T* object, const MultiTypeMath& param1) const
     247            inline void operator()(T* object, const MultiType& param1) const
    248248                { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    249             inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2) const
     249            inline void operator()(T* object, const MultiType& param1, const MultiType& param2) const
    250250                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    251             inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
     251            inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const
    252252                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
    253             inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
     253            inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const
    254254                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }
    255             inline void operator()(T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
     255            inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const
    256256                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }
    257257
     
    259259            inline void operator()(const T* object) const
    260260                { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    261             inline void operator()(const T* object, const MultiTypeMath& param1) const
     261            inline void operator()(const T* object, const MultiType& param1) const
    262262                { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    263             inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2) const
     263            inline void operator()(const T* object, const MultiType& param1, const MultiType& param2) const
    264264                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }
    265             inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const
     265            inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const
    266266                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }
    267             inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const
     267            inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const
    268268                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }
    269             inline void operator()(const T* object, const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const
     269            inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const
    270270                { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }
    271271
  • code/trunk/src/core/Factory.cc

    r1505 r1747  
    3434#include "Factory.h"
    3535#include "Identifier.h"
    36 #include "Debug.h"
    3736#include "BaseObject.h"
     37#include "util/Debug.h"
    3838
    3939namespace orxonox
  • code/trunk/src/core/Functor.h

    r1505 r1747  
    3333#include "CorePrereqs.h"
    3434
    35 #include "util/MultiTypeMath.h"
    36 #include "Debug.h"
     35#include "util/MultiType.h"
     36#include "util/Debug.h"
    3737
    3838#define MAX_FUNCTOR_ARGUMENTS 5
     
    6969    CreateTypeToStringTemplate(long);
    7070    CreateTypeToStringTemplate(unsigned long);
     71    CreateTypeToStringTemplate(long long);
     72    CreateTypeToStringTemplate(unsigned long long);
    7173    CreateTypeToStringTemplate(float);
    7274    CreateTypeToStringTemplate(double);
     
    8082    CreateTypeToStringTemplate(Degree);
    8183
    82     template <> \
    83     inline std::string typeToString<std::string>() { return "string"; } \
    84     template <> \
    85     inline std::string typeToString<std::string&>() { return "string"; } \
    86     template <> \
    87     inline std::string typeToString<const std::string>() { return "string"; } \
    88     template <> \
     84    template <>
     85    inline std::string typeToString<std::string>() { return "string"; }
     86    template <>
     87    inline std::string typeToString<std::string&>() { return "string"; }
     88    template <>
     89    inline std::string typeToString<const std::string>() { return "string"; }
     90    template <>
    8991    inline std::string typeToString<const std::string&>() { return "string"; }
    9092
     
    9597            virtual ~Functor() {}
    9698
    97             virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
     99            virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
    98100
    99101            inline unsigned int getParamCount() const { return this->numParams_; }
    100102            inline bool hasReturnvalue() const { return this->hasReturnValue_; }
    101103            inline FunctionType getType() const { return this->type_; }
    102             inline MultiTypeMath getReturnvalue() const { return this->returnedValue_; }
     104            inline MultiType getReturnvalue() const { return this->returnedValue_; }
    103105
    104106            std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }
    105107            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
    106108
    107             virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0;
     109            virtual void evaluateParam(unsigned int index, MultiType& param) const = 0;
    108110
    109111        protected:
     
    111113            bool hasReturnValue_;
    112114            FunctionType type_;
    113             MultiTypeMath returnedValue_;
     115            MultiType returnedValue_;
    114116
    115117            std::string typeReturnvalue_;
     
    121123        public:
    122124            virtual ~FunctorStatic() {}
    123             virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
     125            virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
    124126    };
    125127
     
    136138            virtual ~FunctorMember() {}
    137139
    138             virtual void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
    139             virtual void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;
    140 
    141             virtual void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)
     140            virtual void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
     141            virtual void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
     142
     143            virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null)
    142144            {
    143145                if (this->bConstObject_)
     
    284286#define FUNCTOR_EVALUATE_PARAM0
    285287#define FUNCTOR_EVALUATE_PARAM1 \
    286     if (index == 0) { P1 temp = param; param = temp; }
     288    if (index == 0) { param.convert<P1>(); }
    287289#define FUNCTOR_EVALUATE_PARAM2 \
    288     if (index == 0) { P1 temp = param; param = temp; } \
    289     else if (index == 1) { P2 temp = param; param = temp; }
     290    if (index == 0) { param.convert<P1>(); } \
     291    else if (index == 1) { param.convert<P2>(); }
    290292#define FUNCTOR_EVALUATE_PARAM3 \
    291     if (index == 0) { P1 temp = param; param = temp; } \
    292     else if (index == 1) { P2 temp = param; param = temp; } \
    293     else if (index == 2) { P3 temp = param; param = temp; }
     293    if (index == 0) { param.convert<P1>(); } \
     294    else if (index == 1) { param.convert<P2>(); } \
     295    else if (index == 2) { param.convert<P3>(); }
    294296#define FUNCTOR_EVALUATE_PARAM4 \
    295     if (index == 0) { P1 temp = param; param = temp; } \
    296     else if (index == 1) { P2 temp = param; param = temp; } \
    297     else if (index == 2) { P3 temp = param; param = temp; } \
    298     else if (index == 3) { P4 temp = param; param = temp; }
     297    if (index == 0) { param.convert<P1>(); } \
     298    else if (index == 1) { param.convert<P2>(); } \
     299    else if (index == 2) { param.convert<P3>(); } \
     300    else if (index == 3) { param.convert<P4>(); }
    299301#define FUNCTOR_EVALUATE_PARAM5 \
    300     if (index == 0) { P1 temp = param; param = temp; } \
    301     else if (index == 1) { P2 temp = param; param = temp; } \
    302     else if (index == 2) { P3 temp = param; param = temp; } \
    303     else if (index == 3) { P4 temp = param; param = temp; } \
    304     else if (index == 4) { P5 temp = param; param = temp; }
     302    if (index == 0) { param.convert<P1>(); } \
     303    else if (index == 1) { param.convert<P2>(); } \
     304    else if (index == 2) { param.convert<P3>(); } \
     305    else if (index == 3) { param.convert<P4>(); } \
     306    else if (index == 4) { param.convert<P5>(); }
    305307
    306308
     
    324326            } \
    325327    \
    326             void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
     328            void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
    327329            { \
    328330                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
    329331            } \
    330332    \
    331             virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
     333            virtual void evaluateParam(unsigned int index, MultiType& param) const \
    332334            { \
    333335                FUNCTOR_EVALUATE_PARAM(numparams); \
     
    362364            } \
    363365    \
    364             void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
     366            void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
    365367            { \
    366368                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
    367369            } \
    368370    \
    369             void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
     371            void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
    370372            { \
    371373                COUT(1) << "An error occurred in Functor.h:" << std::endl; \
     
    373375            } \
    374376    \
    375             virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
     377            virtual void evaluateParam(unsigned int index, MultiType& param) const \
    376378            { \
    377379                FUNCTOR_EVALUATE_PARAM(numparams); \
     
    395397            } \
    396398    \
    397             void operator()(T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
     399            void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
    398400            { \
    399401                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
    400402            } \
    401403    \
    402             void operator()(const T* object, const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
     404            void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
    403405            { \
    404406                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
    405407            } \
    406408    \
    407             virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
     409            virtual void evaluateParam(unsigned int index, MultiType& param) const \
    408410            { \
    409411                FUNCTOR_EVALUATE_PARAM(numparams); \
  • code/trunk/src/core/IRC.cc

    r1505 r1747  
    3939namespace orxonox
    4040{
    41     SetConsoleCommand(IRC, say,  true).setAccessLevel(AccessLevel::User);
    42     SetConsoleCommand(IRC, msg,  false).setAccessLevel(AccessLevel::User);
    43     SetConsoleCommand(IRC, nick, false).setAccessLevel(AccessLevel::User);
    44 
    45     IRC* instance_irc = &IRC::getInstance();
     41    SetConsoleCommand(IRC, say,  true).accessLevel(AccessLevel::User);
     42    SetConsoleCommand(IRC, msg,  false).accessLevel(AccessLevel::User);
     43    SetConsoleCommand(IRC, nick, false).accessLevel(AccessLevel::User);
    4644
    4745    IRC::IRC()
  • code/trunk/src/core/Identifier.cc

    r1543 r1747  
    3737
    3838#include "Factory.h"
     39#include "ConfigValueContainer.h"
    3940#include "ConsoleCommand.h"
    4041#include "CommandExecutor.h"
     42#include "XMLPort.h"
    4143
    4244namespace orxonox
     
    5254    Identifier::Identifier()
    5355    {
     56        this->objects_ = new ObjectListBase(this);
     57
    5458        this->bCreatedOneObject_ = false;
     59        this->bSetName_ = false;
    5560        this->factory_ = 0;
    5661
     
    7378        delete this->children_;
    7479        delete this->directChildren_;
     80        delete this->objects_;
     81
     82        if (this->factory_)
     83            delete this->factory_;
     84
     85        for (std::map<std::string, ConsoleCommand*>::iterator it = this->consoleCommands_.begin(); it != this->consoleCommands_.end(); ++it)
     86            delete (it->second);
     87        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
     88            delete (it->second);
     89        for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it)
     90            delete (it->second);
     91        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
     92            delete (it->second);
    7593    }
    7694
     
    8199        @return The identifier (unique instance)
    82100    */
    83     Identifier *Identifier::getIdentifier(std::string &name, Identifier *proposal)
     101    Identifier* Identifier::getIdentifierSingleton(const std::string& name, Identifier* proposal)
    84102    {
    85103        static std::map<std::string, Identifier*> identifiers;    //!< The map to store all Identifiers.
    86104        std::map<std::string, Identifier*>::const_iterator it = identifiers.find(name);
    87         if (it == identifiers.end())
    88         {
    89             // there isn't an entry yet, put the proposal in it
     105
     106        if (it != identifiers.end())
     107        {
     108            // There is already an entry: return it and delete the proposal
     109            delete proposal;
     110            return (*it).second;
     111        }
     112        else
     113        {
     114            // There is no entry: put the proposal into the map and return it
    90115            identifiers[name] = proposal;
    91         }
    92         else
    93         {
    94             // this happens when a template exists twice --> delete the proposal
    95             delete proposal;
    96         }
    97         return identifiers[name];
     116            return proposal;
     117        }
    98118    }
    99119
     
    139159                // Tell the parent we're one of it's direct children
    140160                (*it)->getDirectChildrenIntern().insert((*it)->getDirectChildrenIntern().end(), this);
     161
     162                // Create the super-function dependencies
     163                (*it)->createSuperFunctionCaller();
    141164            }
     165        }
     166    }
     167
     168    /**
     169        @brief Destroys all Identifiers. Called when exiting the program.
     170    */
     171    void Identifier::destroyAllIdentifiers()
     172    {
     173        for (std::map<std::string, Identifier*>::iterator it = Identifier::getIdentifierMapIntern().begin(); it != Identifier::getIdentifierMapIntern().end(); ++it)
     174            delete (it->second);
     175    }
     176
     177    /**
     178        @brief Sets the name of the class.
     179        @param name The name
     180    */
     181    void Identifier::setName(const std::string& name)
     182    {
     183        if (!this->bSetName_)
     184        {
     185            this->name_ = name;
     186            this->bSetName_ = true;
     187            Identifier::getIdentifierMapIntern()[name] = this;
     188            Identifier::getLowercaseIdentifierMapIntern()[getLowercase(name)] = this;
    142189        }
    143190    }
     
    258305        {
    259306            COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl;
     307            delete (it->second);
    260308        }
    261309
     
    305353        {
    306354            COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl;
     355            delete (it->second);
    307356        }
    308357
     
    343392        else
    344393            return 0;
     394    }
     395
     396    /**
     397        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
     398        @param paramname The name of the parameter
     399        @return The container
     400    */
     401    XMLPortParamContainer* Identifier::getXMLPortParamContainer(const std::string& paramname)
     402    {
     403        std::map<std::string, XMLPortParamContainer*>::const_iterator it = xmlportParamContainers_.find(paramname);
     404        if (it != xmlportParamContainers_.end())
     405            return ((*it).second);
     406        else
     407            return 0;
     408    }
     409
     410    /**
     411        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
     412        @param paramname The name of the parameter
     413        @param container The container
     414    */
     415    void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
     416    {
     417        this->xmlportParamContainers_[paramname] = container;
     418    }
     419
     420    /**
     421        @brief Returns a XMLPortObjectContainer that attaches an object to this class.
     422        @param sectionname The name of the section that contains the attachable objects
     423        @return The container
     424    */
     425    XMLPortObjectContainer* Identifier::getXMLPortObjectContainer(const std::string& sectionname)
     426    {
     427        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = xmlportObjectContainers_.find(sectionname);
     428        if (it != xmlportObjectContainers_.end())
     429            return ((*it).second);
     430        else
     431            return 0;
     432    }
     433
     434    /**
     435        @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
     436        @param sectionname The name of the section that contains the attachable objects
     437        @param container The container
     438    */
     439    void Identifier::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
     440    {
     441        this->xmlportObjectContainers_[sectionname] = container;
    345442    }
    346443
  • code/trunk/src/core/Identifier.h

    r1639 r1747  
    6262#include <stdlib.h>
    6363
    64 #include "ObjectList.h"
    65 #include "Debug.h"
     64#include "MetaObjectList.h"
    6665#include "Iterator.h"
    67 #include "MetaObjectList.h"
     66#include "Super.h"
     67#include "util/Debug.h"
    6868#include "util/String.h"
    6969
     
    9191    {
    9292        template <class T>
    93         friend class ClassIdentifier;
    94 
    95         template <class T>
    9693        friend class SubclassIdentifier;
    9794
     
    110107            bool isDirectParentOf(const Identifier* identifier) const;
    111108
    112             virtual const ObjectList<BaseObject>* getObjectList() const = 0;
    113 
    114             virtual void updateConfigValues() const = 0;
     109            /** @brief Returns the list of all existing objects of this class. @return The list */
     110            inline ObjectListBase* getObjects() const
     111                { return this->objects_; }
    115112
    116113            /** @brief Returns the name of the class the Identifier belongs to. @return The name */
    117114            inline const std::string& getName() const { return this->name_; }
    118 
     115            void setName(const std::string& name);
     116
     117            virtual void updateConfigValues(bool updateChildren = true) const = 0;
    119118
    120119            /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */
     
    210209            ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
    211210
    212             virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
    213             virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0;
    214 
    215             virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
    216             virtual XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname) = 0;
     211            void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
     212            XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
     213
     214            void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
     215            XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
    217216
    218217            ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);
     
    221220
    222221        protected:
     222            Identifier();
     223            Identifier(const Identifier& identifier); // don't copy
     224            virtual ~Identifier();
     225
     226            void initialize(std::set<const Identifier*>* parents);
     227            static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);
     228
     229            virtual void createSuperFunctionCaller() const = 0;
     230
    223231            /** @brief Returns the map that stores all Identifiers. @return The map */
    224232            static std::map<std::string, Identifier*>& getIdentifierMapIntern();
     
    226234            static std::map<std::string, Identifier*>& getLowercaseIdentifierMapIntern();
    227235
    228         private:
    229             Identifier();
    230             Identifier(const Identifier& identifier); // don't copy
    231             virtual ~Identifier();
    232             void initialize(std::set<const Identifier*>* parents);
    233 
    234236            /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */
    235237            inline std::set<const Identifier*>& getChildrenIntern() const { return (*this->children_); }
     
    237239            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
    238240
     241            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
     242            ObjectListBase* objects_;                                      //!< The list of all objects of this class
     243
     244        private:
    239245            /**
    240246                @brief Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
     
    255261            }
    256262
    257             static Identifier* getIdentifier(std::string &name, Identifier *proposal);
     263            static void destroyAllIdentifiers();
    258264
    259265            std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
     
    263269            std::set<const Identifier*>* directChildren_;                  //!< The direct children of the class the Identifier belongs to
    264270
     271            bool bSetName_;                                                //!< True if the name is set
    265272            std::string name_;                                             //!< The name of the class the Identifier belongs to
    266 
    267273            BaseFactory* factory_;                                         //!< The Factory, able to create new objects of the given class (if available)
    268             bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
    269274            static int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
    270275            unsigned int classID_;                                         //!< The network ID to identify a class through the network
     
    277282            std::map<std::string, ConsoleCommand*> consoleCommands_;       //!< All console commands of this class
    278283            std::map<std::string, ConsoleCommand*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
     284
     285            std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
     286            std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_;   //!< All attachable objects
    279287    };
    280288
     
    297305    class ClassIdentifier : public Identifier
    298306    {
     307        #define SUPER_INTRUSIVE_DECLARATION_INCLUDE
     308        #include "Super.h"
     309
    299310        public:
    300             ClassIdentifier<T>* registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass);
     311            static ClassIdentifier<T> *getIdentifier();
     312            static ClassIdentifier<T> *getIdentifier(const std::string& name);
     313            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
     314            static bool isFirstCall();
    301315            void addObject(T* object);
    302             void setName(const std::string& name);
    303             /** @brief Returns the list of all existing objects of this class. @return The list */
    304             inline ObjectList<T>* getObjects() const { return this->objects_; }
    305             /** @brief Returns a list of all existing objects of this class. @return The list */
    306             inline ObjectList<BaseObject>* getObjectList() const { return (ObjectList<BaseObject>*)this->objects_; }
    307 
    308             void updateConfigValues() const;
    309 
    310             XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
    311             void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
    312 
    313             XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
    314             void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
    315 
    316             static ClassIdentifier<T> *getIdentifier();
     316
     317            void updateConfigValues(bool updateChildren = true) const;
    317318
    318319        private:
    319             ClassIdentifier();
    320320            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
    321             ~ClassIdentifier() {}                                       // don't delete
    322 
    323             ObjectList<T>* objects_;                                                                    //!< The ObjectList, containing all objects of type T
    324             bool bSetName_;                                                                             //!< True if the name is set
    325             std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_;              //!< All loadable parameters
    326             std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
     321            ClassIdentifier()
     322            {
     323                SuperFunctionInitialization<0, T>::initialize(this);
     324            }
     325            ~ClassIdentifier()
     326            {
     327                SuperFunctionDestruction<0, T>::destroy(this);
     328            }
    327329
    328330            static ClassIdentifier<T> *classIdentifier_s;
     
    333335
    334336    /**
    335         @brief Constructor: Creates the ObjectList.
    336     */
    337     template <class T>
    338     ClassIdentifier<T>::ClassIdentifier()
    339     {
    340 //        this->objects_ = ObjectList<T>::getList();
    341         this->objects_ = new ObjectList<T>();
    342         this->bSetName_ = false;
    343     }
    344 
    345     /**
    346337        @brief Registers a class, which means that the name and the parents get stored.
    347338        @param parents A list, containing the Identifiers of all parents of the class
    348         @param name A string, containing exactly the name of the class
    349339        @param bRootClass True if the class is either an Interface or the BaseObject itself
    350         @return The ClassIdentifier itself
    351     */
    352     template <class T>
    353     ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass)
    354     {
    355         this->setName(name);
    356 
     340    */
     341    template <class T>
     342    void ClassIdentifier<T>::initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass)
     343    {
    357344        // Check if at least one object of the given type was created
    358345        if (!this->bCreatedOneObject_ && Identifier::isCreatingHierarchy())
    359346        {
    360347            // If no: We have to store the informations and initialize the Identifier
    361             COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl;
     348            COUT(4) << "*** ClassIdentifier: Register Class in " << this->getName() << "-Singleton -> Initialize Singleton." << std::endl;
    362349            if (bRootClass)
    363                 this->initialize(NULL); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
     350                this->initialize(0); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
    364351            else
    365352                this->initialize(parents);
    366353        }
    367 
    368         return this;
    369354    }
    370355
    371356    /**
    372         @brief Creates the only instance of this class for the template class T and retrieves a unique Identifier for the given name.
     357        @brief Returns true if the function gets called the first time, false otherwise.
     358        @return True if this function got called the first time.
     359    */
     360    template <class T>
     361    bool ClassIdentifier<T>::isFirstCall()
     362    {
     363        static bool bFirstCall = true;
     364
     365        if (bFirstCall)
     366        {
     367            bFirstCall = false;
     368            return true;
     369        }
     370        else
     371        {
     372            return false;
     373        }
     374    }
     375
     376    /**
     377        @brief Returns the only instance of this class.
    373378        @return The unique Identifier
    374379    */
     
    377382    {
    378383        // check if the static field has already been filled
    379         if (ClassIdentifier<T>::classIdentifier_s == 0)
     384        if (ClassIdentifier<T>::isFirstCall())
    380385        {
    381386            // Get the name of the class
     
    383388
    384389            // create a new identifier anyway. Will be deleted in Identifier::getIdentifier if not used.
    385             ClassIdentifier<T> *proposal = new ClassIdentifier<T>();
     390            ClassIdentifier<T>* proposal = new ClassIdentifier<T>();
    386391
    387392            // Get the entry from the map
    388             ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)Identifier::getIdentifier(name, proposal);
     393            ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)Identifier::getIdentifierSingleton(name, proposal);
     394
     395            if (ClassIdentifier<T>::classIdentifier_s == proposal)
     396            {
     397                COUT(4) << "*** Identifier: Requested Identifier for " << name << " was not yet existing and got created." << std::endl;
     398            }
     399            else
     400            {
     401                COUT(4) << "*** Identifier: Requested Identifier for " << name << " was already existing and got assigned." << std::endl;
     402            }
    389403        }
    390404
     
    394408
    395409    /**
    396         @brief Sets the name of the class.
    397         @param name The name
    398     */
    399     template <class T>
    400     void ClassIdentifier<T>::setName(const std::string& name)
    401     {
    402         if (!this->bSetName_)
    403         {
    404             this->name_ = name;
    405             this->bSetName_ = true;
    406             Identifier::getIdentifierMapIntern()[name] = this;
    407             Identifier::getLowercaseIdentifierMapIntern()[getLowercase(name)] = this;
    408         }
     410        @brief Does the same as getIdentifier() but sets the name if this wasn't done yet.
     411        @param name The name of this Identifier
     412        @return The Identifier
     413    */
     414    template <class T>
     415    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
     416    {
     417        ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
     418        identifier->setName(name);
     419        return identifier;
    409420    }
    410421
     
    417428    {
    418429        COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
    419         object->getMetaList().add(this->objects_, this->objects_->add(object));
     430        object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
    420431    }
    421432
     
    424435    */
    425436    template <class T>
    426     void ClassIdentifier<T>::updateConfigValues() const
    427     {
    428         for (Iterator<T> it = this->objects_->start(); it; ++it)
    429             ((T*)*it)->setConfigValues();
    430     }
    431 
    432     /**
    433         @brief Returns a XMLPortParamContainer that loads a parameter of this class.
    434         @param paramname The name of the parameter
    435         @return The container
    436     */
    437     template <class T>
    438     XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname)
    439     {
    440         typename std::map<std::string, XMLPortClassParamContainer<T>*>::const_iterator it = xmlportParamContainers_.find(paramname);
    441         if (it != xmlportParamContainers_.end())
    442             return (XMLPortParamContainer*)((*it).second);
    443         else
    444             return 0;
    445     }
    446 
    447     /**
    448         @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
    449         @param paramname The name of the parameter
    450         @param container The container
    451     */
    452     template <class T>
    453     void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
    454     {
    455         this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<T>*)container;
    456     }
    457 
    458     /**
    459         @brief Returns a XMLPortObjectContainer that attaches an object to this class.
    460         @param sectionname The name of the section that contains the attachable objects
    461         @return The container
    462     */
    463     template <class T>
    464     XMLPortObjectContainer* ClassIdentifier<T>::getXMLPortObjectContainer(const std::string& sectionname)
    465     {
    466         typename std::map<std::string, XMLPortClassObjectContainer<T, class O>*>::const_iterator it = xmlportObjectContainers_.find(sectionname);
    467         if (it != xmlportObjectContainers_.end())
    468             return (XMLPortObjectContainer*)((*it).second);
    469         else
    470             return 0;
    471     }
    472 
    473     /**
    474         @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
    475         @param sectionname The name of the section that contains the attachable objects
    476         @param container The container
    477     */
    478     template <class T>
    479     void ClassIdentifier<T>::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
    480     {
    481         this->xmlportObjectContainers_[sectionname] = (XMLPortClassObjectContainer<T, class O>*)container;
     437    void ClassIdentifier<T>::updateConfigValues(bool updateChildren) const
     438    {
     439        if (!this->hasConfigValues())
     440            return;
     441
     442        for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
     443            it->setConfigValues();
     444
     445        if (updateChildren)
     446            for (std::set<const Identifier*>::const_iterator it = this->getChildrenBegin(); it != this->getChildrenEnd(); ++it)
     447                (*it)->updateConfigValues(false);
    482448    }
    483449
  • code/trunk/src/core/Iterator.h

    r1625 r1747  
    3131    @brief Definition and implementation of the Iterator class.
    3232
    33     The Iterator of a given class allows to iterate through an ObjectList, containing all objects of that type.
    34     This is the only way to access the objects stored in an ObjectList.
     33    The Iterator of a given class allows to iterate through an ObjectList. Objects in
     34    this list are casted to the template argument of the Iterator.
    3535
    3636    Usage:
    37     for (Iterator<class> it = ObjectList<class>::start(); it != 0; ++it)
     37    for (Iterator<myClass> it = anyidentifier->getObjects().begin(); it != anyidentifier->getObjects().end(); ++it)
    3838    {
    3939        it->someFunction(...);
    40         class* myObject = *it;
     40        myClass* myObject = *it;
    4141    }
    42 
    43     Warning: Don't delete objects directly through the iterator.
    4442*/
    4543
     
    4947#include "CorePrereqs.h"
    5048
    51 #include "ObjectList.h"
     49#include "ObjectListBase.h"
     50#include "ObjectListIterator.h"
     51#include "OrxonoxClass.h"
    5252
    5353namespace orxonox
    5454{
    55     //! The iterator allows to iterate through an ObjectList of a given class.
    56     template <class T>
     55    //! The Iterator allows to iterate through a given ObjectList
     56    template <class T = OrxonoxClass>
    5757    class Iterator
    5858    {
     
    6161                @brief Constructor: Sets the element, whereon the iterator points, to zero.
    6262            */
    63             Iterator()
     63            inline Iterator()
    6464            {
    6565                this->element_ = 0;
    66                 ClassIdentifier<T>::getIdentifier()->getObjects()->registerIterator(this);
    67             }
    68 
    69             /**
    70                 @brief Constructor: Sets the element, whereon the iterator points, to a given element.
    71                 @param element The element to start with
    72             */
    73             Iterator(ObjectListElement<T>* element)
    74             {
    75                 this->element_ = element;
    76                 ClassIdentifier<T>::getIdentifier()->getObjects()->registerIterator(this);
     66                this->list_ = 0;
     67            }
     68
     69            /**
     70                @brief Constructor: Sets this element to the exported element.
     71                @param exp The exported element
     72            */
     73            inline Iterator(const ObjectListBase::Export& exp)
     74            {
     75                this->element_ = exp.element_;
     76                this->list_ = exp.list_;
     77                this->iterator_ = this->list_->registerIterator(this);
     78            }
     79
     80            /**
     81                @brief Constructor: Sets this element to the element of another Iterator.
     82                @param other The other Iterator
     83            */
     84            inline Iterator(const Iterator<T>& other)
     85            {
     86                this->element_ = other.element_;
     87                this->list_ = other.list_;
     88                this->iterator_ = this->list_->registerIterator(this);
     89            }
     90
     91            /**
     92                @brief Constructor: Sets this element to a given element
     93                @param element The element
     94            */
     95            template <class O>
     96            inline Iterator(ObjectListElement<O>* element)
     97            {
     98                this->element_ = (element) ? (ObjectListBaseElement*)element : 0;
     99                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
     100                this->iterator_ = this->list_->registerIterator(this);
     101            }
     102
     103            /**
     104                @brief Constructor: Sets this element to the element an ObjectListIterator.
     105                @param other The ObjectListIterator
     106            */
     107            template <class O>
     108            inline Iterator(const ObjectListIterator<O>& other)
     109            {
     110                this->element_ = (other.element_) ? (ObjectListBaseElement*)other.element_ : 0;
     111                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
     112                this->iterator_ = this->list_->registerIterator(this);
    77113            }
    78114
     
    80116                @brief Unregisters the Iterator from the ObjectList.
    81117            */
    82             ~Iterator()
    83             {
    84                 ClassIdentifier<T>::getIdentifier()->getObjects()->unregisterIterator(this);
    85             }
    86 
    87             /**
    88                 @brief Assigns an element to the iterator.
     118            inline ~Iterator()
     119            {
     120                this->list_->unregisterIterator(this->iterator_);
     121            }
     122
     123            /**
     124                @brief Assigns an exported element.
     125                @param exp The exported element
     126            */
     127            inline const Iterator<T>& operator=(const ObjectListBase::Export& exp)
     128            {
     129                if (this->list_)
     130                    this->list_->unregisterIterator(this->iterator_);
     131
     132                this->element_ = exp.element_;
     133                this->list_ = exp.list_;
     134                this->iterator_ = this->list_->registerIterator(this);
     135
     136                return (*this);
     137            }
     138
     139            /**
     140                @brief Assigns the element of another Iterator.
     141                @param other The other Iterator
     142            */
     143            inline const Iterator<T>& operator=(const Iterator<T>& other)
     144            {
     145                if (this->list_)
     146                    this->list_->unregisterIterator(this->iterator_);
     147
     148                this->element_ = other.element_;
     149                this->list_ = other.list_;
     150                this->iterator_ = this->list_->registerIterator(this);
     151
     152                return (*this);
     153            }
     154
     155            /**
     156                @brief Assigns a given element.
    89157                @param element The element
    90158            */
    91             Iterator<T> operator=(ObjectListElement<T>* element)
    92             {
    93                 this->element_ = element;
     159            template <class O>
     160            inline const Iterator<T>& operator=(ObjectListElement<O>* element)
     161            {
     162                if (this->list_)
     163                    this->list_->unregisterIterator(this->iterator_);
     164
     165                this->element_ = (element) ? (ObjectListBaseElement*)element : 0;
     166                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
     167                this->iterator_ = this->list_->registerIterator(this);
     168
     169                return (*this);
    94170                return *this;
     171            }
     172
     173            /**
     174                @brief Assigns the element of an ObjectListIterator.
     175                @param other The ObjectListIterator
     176            */
     177            template <class O>
     178            inline const Iterator<T>& operator=(const ObjectListIterator<O>& other)
     179            {
     180                if (this->list_)
     181                    this->list_->unregisterIterator(this->iterator_);
     182
     183                this->element_ = (other.element_) ? (ObjectListBaseElement*)other.element_ : 0;
     184                this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects();
     185                this->iterator_ = this->list_->registerIterator(this);
     186
     187                return (*this);
    95188            }
    96189
     
    99192                @return The Iterator itself
    100193            */
    101             Iterator<T> operator++()
     194            inline const Iterator<T>& operator++()
    102195            {
    103196                if (this->element_)
     
    110203                @return The Iterator itself
    111204            */
    112             Iterator<T> operator++(int i)
     205            inline Iterator<T> operator++(int i)
    113206            {
    114207                Iterator<T> copy = *this;
     
    122215                @return The Iterator itself
    123216            */
    124             Iterator<T> operator--()
     217            inline const Iterator<T>& operator--()
    125218            {
    126219                if (this->element_)
     
    133226                @return The Iterator itself
    134227            */
    135             Iterator<T> operator--(int i)
     228            inline Iterator<T> operator--(int i)
    136229            {
    137230                Iterator<T> copy = *this;
     
    145238                @return The object the Iterator points at
    146239            */
    147             T* operator*()
    148             {
    149                 if (this->element_)
    150                     return this->element_->object_;
     240            inline T* operator*() const
     241            {
     242                if (this->element_)
     243                    return dynamic_cast<T*>(this->element_->objectBase_);
    151244                else
    152245                    return 0;
     
    157250                @return The object the Iterator points at
    158251            */
    159             T* operator->() const
    160             {
    161                 if (this->element_)
    162                     return this->element_->object_;
     252            inline T* operator->() const
     253            {
     254                if (this->element_)
     255                    return dynamic_cast<T*>(this->element_->objectBase_);
    163256                else
    164257                    return 0;
    165 
    166258            }
    167259
    168260            /**
    169261                @brief Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.
    170                 @return True if the iterator points to an existing object.
    171             */
    172             operator bool()
     262                @return True if the Iterator points to an existing object.
     263            */
     264            inline operator bool() const
    173265            {
    174266                return (this->element_ != 0);
     
    176268
    177269            /**
    178                 @brief Overloading of the (it != int) operator: Used for (it != 0) instead of typecast-operator to bool.
    179                 @param compare The integer (must be zero, everything else makes no sense).
    180                 @return True if the iterator points to an existing object.
    181             */
    182             bool operator!=(ObjectListElement<T>* compare)
    183             {
    184                 return (this->element_ != compare);
    185             }
    186 
    187         private:
    188             ObjectListElement<T>* element_;     //!< The element the Iterator points at
     270                @brief Overloading of the == operator to compare with another Iterator.
     271                @param compare The other Iterator
     272                @return True if the iterators point to the same element
     273            */
     274            inline bool operator==(const Iterator<T>& compare) const
     275            {
     276                return (this->element_ == compare.element_);
     277            }
     278
     279            /**
     280                @brief Overloading of the != operator to compare with another Iterator.
     281                @param compare The other Iterator
     282                @return True if the iterators point to different elements
     283            */
     284            inline bool operator!=(const Iterator<T>& compare) const
     285            {
     286                return (this->element_ != compare.element_);
     287            }
     288
     289            /**
     290                @brief Increments the Iterator if it points at the given object.
     291                @param object The object to compare with
     292            */
     293            inline void incrementIfEqual(OrxonoxClass* object)
     294            {
     295                if (this->element_ && this->element_->objectBase_ == object)
     296                    this->operator++();
     297            }
     298
     299        protected:
     300            ObjectListBaseElement* element_;       //!< The element the Iterator points at
     301            ObjectListBase* list_;                 //!< The list wherein the element is
     302            std::list<void*>::iterator iterator_;  //!< The iterator in the notifying list of the ObjectList
    189303    };
     304
     305    typedef Iterator<OrxonoxClass> BaseIterator;
    190306}
    191307
     308// Include ObjectList.h so the user only has to include one file: Iterator.h
     309#include "ObjectList.h"
     310
    192311#endif /* _Iterator_H__ */
  • code/trunk/src/core/Language.cc

    r1535 r1747  
    3737
    3838#include "Core.h"
    39 
    40 #include "Debug.h"
     39#include "util/Debug.h"
    4140
    4241namespace orxonox
     
    9897        // Read the default language file to create all known LanguageEntry objects
    9998        this->readDefaultLanguageFile();
     99    }
     100
     101    /**
     102        @brief Destructor: Deletes all language entries.
     103    */
     104    Language::~Language()
     105    {
     106        for (std::map<std::string, LanguageEntry*>::iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
     107            delete (it->second);
    100108    }
    101109
  • code/trunk/src/core/Language.h

    r1535 r1747  
    123123            Language();
    124124            Language(const Language& language);     // don't copy
    125             virtual ~Language() {};                 // don't delete
     125            virtual ~Language();
    126126
    127127            void readDefaultLanguageFile();
  • code/trunk/src/core/Loader.cc

    r1625 r1747  
    3232#include "Identifier.h"
    3333#include "Iterator.h"
    34 #include "Debug.h"
     34#include "ObjectList.h"
    3535#include "CoreIncludes.h"
    3636#include "Script.h"
    3737#include "Namespace.h"
     38#include "util/Debug.h"
    3839
    3940#include "tinyxml/ticpp.h"
     
    9192    void Loader::unload(const ClassTreeMask& mask)
    9293    {
    93         for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; )
     94        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); )
    9495        {
    9596            if (mask.isIncluded(it->getIdentifier()))
     
    165166    void Loader::unload(const Level* level, const ClassTreeMask& mask)
    166167    {
    167         for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; )
     168        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; )
    168169        {
    169170            if ((it->getLevel() == level) && mask.isIncluded(it->getIdentifier()))
  • code/trunk/src/core/MetaObjectList.cc

    r1505 r1747  
    3333
    3434#include "MetaObjectList.h"
     35#include "ObjectListBase.h"
     36#include "Identifier.h"
     37#include "util/Debug.h"
    3538
    3639namespace orxonox
    3740{
     41    // ###############################
     42    // ###  MetaObjectListElement  ###
     43    // ###############################
     44    /**
     45        @brief Destructor: Removes the ObjectListBaseElement from the ObjectListBase by linking next_ and prev_ of the ObjectListBaseElement.
     46    */
     47    MetaObjectListElement::~MetaObjectListElement()
     48    {
     49        COUT(5) << "*** MetaObjectList: Removing Object from " << this->list_->getIdentifier()->getName() << "-list." << std::endl;
     50        this->list_->notifyIterators(this->element_->objectBase_);
     51
     52        if (this->element_->next_)
     53            this->element_->next_->prev_ = this->element_->prev_;
     54        else
     55            this->list_->last_ = this->element_->prev_; // If there is no next_, we deleted the last object and have to update the last_ pointer of the list
     56
     57        if (this->element_->prev_)
     58            this->element_->prev_->next_ = this->element_->next_;
     59        else
     60            this->list_->first_ = this->element_->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
     61
     62        delete this->element_;
     63    }
     64
     65
     66    // ###############################
     67    // ###     MetaObjectList      ###
     68    // ###############################
    3869    /**
    3970        @brief Constructor: Sets first_ to zero.
     
    4980    MetaObjectList::~MetaObjectList()
    5081    {
    51         BaseMetaObjectListElement* temp;
     82        MetaObjectListElement* temp;
    5283        while (this->first_)
    5384        {
     
    5788        }
    5889    }
     90
     91    /**
     92        @brief Adds an ObjectList and an element of that list to the MetaObjectList.
     93        @param list The ObjectList wherein the element is
     94        @param element The element wherein the object is
     95    */
     96    void MetaObjectList::add(ObjectListBase* list, ObjectListBaseElement* element)
     97    {
     98        MetaObjectListElement* temp = this->first_;
     99        this->first_ = new MetaObjectListElement(list, element);
     100        this->first_->next_ = temp;
     101    }
    59102}
  • code/trunk/src/core/MetaObjectList.h

    r1543 r1747  
    4141#include "CorePrereqs.h"
    4242
    43 #include "ObjectList.h"
    44 #include "Identifier.h"
    45 #include "Debug.h"
    46 
    4743namespace orxonox
    4844{
    49     //! Base-class of MetaObjectListElement, because those is a template
    50     class BaseMetaObjectListElement
    51     {
    52         public:
    53             /** @brief Default destructor */
    54             virtual ~BaseMetaObjectListElement() {};
    55 
    56             BaseMetaObjectListElement* next_;       //!< The next Element in the list
    57     };
    58 
    5945    // ###############################
    6046    // ###  MetaObjectListElement  ###
    6147    // ###############################
    6248    //! The list-element of the MetaObjectList
    63     template <class T>
    64     class MetaObjectListElement : public BaseMetaObjectListElement
     49    class _CoreExport MetaObjectListElement
    6550    {
    6651        public:
    67             MetaObjectListElement(ObjectList<T>* list, ObjectListElement<T>* element);
    68             virtual ~MetaObjectListElement();
     52            /**
     53                @brief Constructor: Creates the list-element with given list and element.
     54            */
     55            MetaObjectListElement(ObjectListBase* list, ObjectListBaseElement* element) : next_(0), element_(element), list_(list) {}
     56            ~MetaObjectListElement();
    6957
    70             ObjectListElement<T>* element_;         //!< The list element, containing the object
    71             ObjectList<T>* list_;                   //!< The list, containing the element
     58            MetaObjectListElement* next_;       //!< The next Element in the list
     59            ObjectListBaseElement* element_;    //!< The list element, containing the object
     60            ObjectListBase* list_;              //!< The list, containing the element
    7261    };
    73 
    74     /**
    75         @brief Constructor: Creates the list-element with given list and element.
    76     */
    77     template <class T>
    78     MetaObjectListElement<T>::MetaObjectListElement(ObjectList<T>* list, ObjectListElement<T>* element)
    79     {
    80         this->element_ = element;
    81         this->list_ = list;
    82         this->next_ = 0;
    83     }
    84 
    85     /**
    86         @brief Destructor: Removes the ObjectListElement from the ObjectList by linking next_ and prev_ of the ObjectListElement.
    87     */
    88     template <class T>
    89     MetaObjectListElement<T>::~MetaObjectListElement()
    90     {
    91         COUT(5) << "*** MetaObjectList: Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl;
    92         this->list_->notifyIterators(this->element_);
    93 
    94         if (this->element_->next_)
    95             this->element_->next_->prev_ = this->element_->prev_;
    96         else
    97             this->list_->last_ = this->element_->prev_; // If there is no next_, we deleted the last object and have to update the last_ pointer of the list
    98 
    99         if (this->element_->prev_)
    100             this->element_->prev_->next_ = this->element_->next_;
    101         else
    102             this->list_->first_ = this->element_->next_; // If there is no prev_, we deleted the first object and have to update the first_ pointer of the list
    103 
    104         delete this->element_;
    105     }
    10662
    10763
     
    10965    // ###     MetaObjectList      ###
    11066    // ###############################
    111     //!  The MetaObjectList contains ObjectListElements and their ObjectLists.
     67    //!  The MetaObjectList contains ObjectListBaseElements and their ObjectListBases.
    11268    /**
    11369        The MetaObjectList is a single-linked list, containing all list-elements and their
     
    12076            MetaObjectList();
    12177            ~MetaObjectList();
    122             template <class T>
    123             void add(ObjectList<T>* list, ObjectListElement<T>* element);
     78            void add(ObjectListBase* list, ObjectListBaseElement* element);
    12479
    125             BaseMetaObjectListElement* first_;      //!< The first element in the list
     80            MetaObjectListElement* first_;      //!< The first element in the list
    12681    };
    127 
    128     /**
    129         @brief Adds an ObjectList and an element of that list to the MetaObjectList.
    130         @param list The ObjectList wherein the element is
    131         @param element The element wherein the object is
    132     */
    133     template <class T>
    134     void MetaObjectList::add(ObjectList<T>* list, ObjectListElement<T>* element)
    135     {
    136         BaseMetaObjectListElement* temp = this->first_;
    137         this->first_ = new MetaObjectListElement<T>(list, element);
    138         this->first_->next_ = temp;
    139     }
    14082}
    14183
  • code/trunk/src/core/Namespace.cc

    r1505 r1747  
    6060    void Namespace::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6161    {
    62         BaseObject::XMLPort(xmlelement, mode);
     62        SUPER(Namespace, XMLPort, xmlelement, mode);
    6363
    6464        std::string name = this->getName();
  • code/trunk/src/core/NamespaceNode.cc

    r1505 r1747  
    2828
    2929#include "NamespaceNode.h"
    30 #include "Debug.h"
     30#include "util/Debug.h"
    3131
    3232namespace orxonox
  • code/trunk/src/core/ObjectList.h

    r1543 r1747  
    3131    @brief Definition and implementation of the ObjectList class.
    3232
    33     The ObjectList is a double-linked list, used by Identifiers to store all objects of a given class.
    34     Newly created objects are added through the RegisterObject-macro in its constructor.
     33    The ObjectList is a wrapper of an ObjectListBase of a given class.
    3534    Use Iterator<class> to iterate through all objects of the class.
    3635*/
     
    3938#define _ObjectList_H__
    4039
    41 #include <set>
    42 
    4340#include "CorePrereqs.h"
    4441
    45 #include "Iterator.h"
    4642#include "Identifier.h"
     43#include "ObjectListIterator.h"
    4744
    4845namespace orxonox
    4946{
    5047    // ###############################
    51     // ###    ObjectListElement    ###
    52     // ###############################
    53     //! The list-element of the ObjectList
    54     template <class T>
    55     class ObjectListElement
    56     {
    57         public:
    58             ObjectListElement(T* object);
    59 
    60             T* object_;                     //!< The object
    61             ObjectListElement* next_;       //!< The next element in the list
    62             ObjectListElement* prev_;       //!< The previous element in the list
    63     };
    64 
    65     /**
    66         @brief Constructor: Creates the list-element with an object.
    67         @param object The object to store
    68     */
    69     template <class T>
    70     ObjectListElement<T>::ObjectListElement(T* object)
    71     {
    72         this->object_ = object;
    73         this->next_ = 0;
    74         this->prev_ = 0;
    75     }
    76 
    77 
    78     // ###############################
    7948    // ###       ObjectList        ###
    8049    // ###############################
    81     //! The ObjectList contains all objects of a given class.
     50    //! The ObjectList contains all objects of the given class.
    8251    /**
    83         The ObjectList is used by Identifiers to store all objects of a given class.
    84         Use Iterator<class> to iterate through all objects in the list.
     52        Wraps the ObjectListBase of the corresponding Identifier.
     53        Use ObjectListIterator<class> to iterate through all objects in the list.
    8554    */
    8655    template <class T>
     
    8857    {
    8958        public:
    90             ObjectList();
    91             ~ObjectList();
     59            typedef ObjectListIterator<T> iterator;
    9260
    93             ObjectListElement<T>* add(T* object);
     61            /** @brief Returns an Iterator to the first element in the list. @return The Iterator */
     62            inline static ObjectListElement<T>* begin()
     63                { return ((ObjectListElement<T>*)ClassIdentifier<T>::getIdentifier()->getObjects()->begin().element_); }
    9464
    95             /** @brief Returns the first element in the list. @return The first element */
    96             inline static Iterator<T> start()
    97                 { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->first_); }
     65            /** @brief Returns an Iterator to the element after the last element in the list. @return The Iterator */
     66            inline static ObjectListElement<T>* end()
     67                { return ((ObjectListElement<T>*)ClassIdentifier<T>::getIdentifier()->getObjects()->end().element_); }
    9868
    99             /** @brief Returns the first element in the list. @return The first element */
    100             inline static Iterator<T> begin()
    101                 { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->first_); }
     69            /** @brief Returns an Iterator to the last element in the list. @return The Iterator */
     70            inline static ObjectListElement<T>* rbegin()
     71                { return ((ObjectListElement<T>*)ClassIdentifier<T>::getIdentifier()->getObjects()->rbegin().element_); }
    10272
    103             /** @brief Returns the last element in the list. @return The last element */
    104             inline static Iterator<T> end()
    105                 { return Iterator<T>(ClassIdentifier<T>::getIdentifier()->getObjects()->last_); }
    106 
    107             inline void registerIterator(Iterator<T>* iterator)
    108                 { this->iterators_.insert(this->iterators_.end(), (void*)iterator); }
    109             inline void unregisterIterator(Iterator<T>* iterator)
    110                 { this->iterators_.erase((void*)iterator); }
    111             void notifyIterators(ObjectListElement<T>* element);
    112 
    113             ObjectListElement<T>* first_;       //!< The first element in the list
    114             ObjectListElement<T>* last_;        //!< The last element in the list
    115 
    116         private:
    117             std::set<void*> iterators_;  //!< A list of iterators pointing on an element in this list
     73            /** @brief Returns an Iterator to the element before the first element in the list. @return The Iterator */
     74            inline static ObjectListElement<T>* rend()
     75                { return ((ObjectListElement<T>*)ClassIdentifier<T>::getIdentifier()->getObjects()->rend().element_); }
    11876    };
    119 
    120     /**
    121         @brief Constructor: Sets default values.
    122     */
    123     template <class T>
    124     ObjectList<T>::ObjectList()
    125     {
    126         this->first_ = 0;
    127         this->last_ = 0;
    128     }
    129 
    130     /**
    131         @brief Destructor: Deletes all list-elements, but NOT THE OBJECTS.
    132     */
    133     template <class T>
    134     ObjectList<T>::~ObjectList()
    135     {
    136         ObjectListElement<T>* temp;
    137         while (this->first_)
    138         {
    139             temp = this->first_->next_;
    140             delete this->first_;
    141             this->first_ = temp;
    142         }
    143     }
    144 
    145     /**
    146         @brief Increases all Iterators that currently point on the given element (because it gets removed).
    147         @param element The element that gets removed
    148     */
    149     template <class T>
    150     void ObjectList<T>::notifyIterators(ObjectListElement<T>* element)
    151     {
    152         for (std::set<void*>::iterator it = this->iterators_.begin(); it != this->iterators_.end(); ++it)
    153             if ((*(*((Iterator<T>*)(*it)))) == element->object_)
    154                 ++(*((Iterator<T>*)(*it)));
    155     }
    156 
    157     /**
    158         @brief Adds a new object to the end of the list.
    159         @param object The object to add
    160         @return The pointer to the new ObjectListElement, needed by the MetaObjectList of the added object
    161     */
    162     template <class T>
    163     ObjectListElement<T>* ObjectList<T>::add(T* object)
    164     {
    165         if (!this->last_)
    166         {
    167             // If the list is empty
    168             this->last_ = new ObjectListElement<T>(object);
    169             this->first_ = this->last_; // There's only one object in the list now
    170         }
    171         else
    172         {
    173             // If the list isn't empty
    174             ObjectListElement<T>* temp = this->last_;
    175             this->last_ = new ObjectListElement<T>(object);
    176             this->last_->prev_ = temp;
    177             temp->next_ = this->last_;
    178         }
    179 
    180         return this->last_;
    181     }
    18277}
    18378
  • code/trunk/src/core/OrxonoxClass.cc

    r1505 r1747  
    3939{
    4040    /** @brief Constructor: Sets the default values. */
    41     OrxonoxClass::OrxonoxClass() :
    42       identifier_(0),
    43       parents_(0)
     41    OrxonoxClass::OrxonoxClass()
    4442    {
     43        this->identifier_ = 0;
     44        this->parents_ = 0;
    4545        this->metaList_ = new MetaObjectList();
    46 
    47         this->setConfigValues();
    4846    }
    4947
  • code/trunk/src/core/Shell.cc

    r1540 r1747  
    3434#include "ConsoleCommand.h"
    3535#include "input/InputInterfaces.h"
     36#include "util/OutputHandler.h"
    3637
    3738#define SHELL_UPDATE_LISTENERS(function) \
     
    4344    SetConsoleCommand(Shell, clearShell, true);
    4445    SetConsoleCommand(Shell, history, true);
     46
     47    SetConsoleCommandShortcut(OutputHandler, log);
     48    SetConsoleCommandShortcut(OutputHandler, error);
     49    SetConsoleCommandShortcut(OutputHandler, warning);
     50    SetConsoleCommandShortcut(OutputHandler, info);
     51    SetConsoleCommandShortcut(OutputHandler, debug);
    4552
    4653    Shell::Shell()
     
    6168
    6269        this->outputBuffer_.registerListener(this);
     70        OutputHandler::getOutStream().setOutputBuffer(this->outputBuffer_);
    6371
    6472        this->setConfigValues();
     
    8290    void Shell::setConfigValues()
    8391    {
    84         SetConfigValue(maxHistoryLength_, 100);
    85         SetConfigValue(historyOffset_, 0);
     92        SetConfigValue(maxHistoryLength_, 100).callback(this, &Shell::commandHistoryLengthChanged);
     93        SetConfigValue(historyOffset_, 0).callback(this, &Shell::commandHistoryOffsetChanged);
    8694        SetConfigValueVector(commandHistory_, std::vector<std::string>());
    87 
     95    }
     96
     97    void Shell::commandHistoryOffsetChanged()
     98    {
    8899        if (this->historyOffset_ >= this->maxHistoryLength_)
    89100            this->historyOffset_ = 0;
     101    }
     102
     103    void Shell::commandHistoryLengthChanged()
     104    {
     105        this->commandHistoryOffsetChanged();
    90106
    91107        while (this->commandHistory_.size() > this->maxHistoryLength_)
  • code/trunk/src/core/Shell.h

    r1535 r1747  
    3737#include "OrxonoxClass.h"
    3838#include "input/InputBuffer.h"
    39 #include "OutputBuffer.h"
     39#include "util/OutputBuffer.h"
    4040
    4141namespace orxonox
     
    6767
    6868            virtual void setConfigValues();
     69            void commandHistoryOffsetChanged();
     70            void commandHistoryLengthChanged();
    6971
    7072            void registerListener(ShellListener* listener);
  • code/trunk/src/core/TclBind.cc

    r1505 r1747  
    3232#include "ConsoleCommand.h"
    3333#include "CommandExecutor.h"
    34 #include "Debug.h"
    3534#include "TclThreadManager.h"
    3635#include "TclBind.h"
     36#include "util/Debug.h"
    3737#include "util/String.h"
    3838
    3939namespace orxonox
    4040{
    41     SetConsoleCommandShortcutGeneric(tcl, createConsoleCommand(createFunctor(&TclBind::tcl), "tcl"));
    42     SetConsoleCommandShortcutGeneric(bgerror, createConsoleCommand(createFunctor(&TclBind::bgerror), "bgerror"));
     41    SetConsoleCommandShortcut(TclBind, tcl);
     42    SetConsoleCommandShortcut(TclBind, bgerror);
    4343
    4444    TclBind::TclBind()
     
    115115
    116116        if (CommandExecutor::getLastEvaluation().hasReturnvalue())
    117             return CommandExecutor::getLastEvaluation().getReturnvalue().toString();
     117            return CommandExecutor::getLastEvaluation().getReturnvalue().getString();
    118118
    119119        return "";
  • code/trunk/src/core/TclThreadManager.cc

    r1505 r1747  
    3838#include "ConsoleCommand.h"
    3939#include "CommandExecutor.h"
    40 #include "Debug.h"
    4140#include "TclBind.h"
    4241#include "TclThreadManager.h"
     42#include "util/Debug.h"
    4343#include "util/Convert.h"
    4444
     
    4848namespace orxonox
    4949{
    50     SetConsoleCommandShortcutGeneric(tclexecute, createConsoleCommand(createFunctor(&TclThreadManager::execute), "tclexecute")).setArgumentCompleter(0, autocompletion::tclthreads());
    51     SetConsoleCommandShortcutGeneric(tclquery,   createConsoleCommand(createFunctor(&TclThreadManager::query),   "tclquery"  )).setArgumentCompleter(0, autocompletion::tclthreads());
     50    SetConsoleCommandShortcutAlias(TclThreadManager, execute, "tclexecute").argumentCompleter(0, autocompletion::tclthreads());
     51    SetConsoleCommandShortcutAlias(TclThreadManager, query,   "tclquery"  ).argumentCompleter(0, autocompletion::tclthreads());
    5252    SetConsoleCommand(TclThreadManager, create,  false);
    53     SetConsoleCommand(TclThreadManager, destroy, false).setArgumentCompleter(0, autocompletion::tclthreads());
    54     SetConsoleCommand(TclThreadManager, execute, false).setArgumentCompleter(0, autocompletion::tclthreads());
    55     SetConsoleCommand(TclThreadManager, query,   false).setArgumentCompleter(0, autocompletion::tclthreads());
     53    SetConsoleCommand(TclThreadManager, destroy, false).argumentCompleter(0, autocompletion::tclthreads());
     54    SetConsoleCommand(TclThreadManager, execute, false).argumentCompleter(0, autocompletion::tclthreads());
     55    SetConsoleCommand(TclThreadManager, query,   false).argumentCompleter(0, autocompletion::tclthreads());
    5656    SetConsoleCommand(TclThreadManager, status,  false);
    57     SetConsoleCommand(TclThreadManager, dump,    false).setArgumentCompleter(0, autocompletion::tclthreads());
    58     SetConsoleCommand(TclThreadManager, flush,   false).setArgumentCompleter(0, autocompletion::tclthreads());
    59 
    60     TclThreadManager* instance_tclthreadmanager = &TclThreadManager::getInstance();
     57    SetConsoleCommand(TclThreadManager, dump,    false).argumentCompleter(0, autocompletion::tclthreads());
     58    SetConsoleCommand(TclThreadManager, flush,   false).argumentCompleter(0, autocompletion::tclthreads());
    6159
    6260    TclThreadManager::TclThreadManager()
     
    7270        //
    7371#endif
     72    }
     73
     74    TclThreadManager::~TclThreadManager()
     75    {
     76        unsigned int threadID;
     77        {
     78            boost::mutex::scoped_lock bundles_lock(this->bundlesMutex_);
     79            if (this->interpreterBundles_.begin() == this->interpreterBundles_.end())
     80                return;
     81            else
     82                threadID = this->interpreterBundles_.begin()->first;
     83        }
     84        this->destroy(threadID);
    7485    }
    7586
     
    508519
    509520                if (CommandExecutor::getLastEvaluation().hasReturnvalue())
    510                     output = CommandExecutor::getLastEvaluation().getReturnvalue().toString();
     521                    output = CommandExecutor::getLastEvaluation().getReturnvalue().getString();
    511522            }
    512523
  • code/trunk/src/core/TclThreadManager.h

    r1625 r1747  
    6969    class _CoreExport TclThreadManager : public OrxonoxClass
    7070    {
     71        friend class IRC;
     72        friend class TclBind;
     73
    7174        public:
    7275            static TclThreadManager& getInstance();
     
    8184            static void flush(unsigned int threadID);
    8285
     86            void error(const std::string& error);
     87            void debug(const std::string& error);
     88
     89            virtual void tick(float dt);
     90
     91            std::list<unsigned int> getThreadList() const;
     92
     93        private:
     94            TclThreadManager();
     95            TclThreadManager(const TclThreadManager& other);
     96            ~TclThreadManager();
     97
    8398            static void tcl_execute(Tcl::object const &args);
    8499            static std::string tcl_query(int querierID, Tcl::object const &args);
     
    89104            TclInterpreterBundle* getInterpreterBundle(unsigned int threadID);
    90105            std::string dumpList(const std::list<unsigned int>& list);
    91             void error(const std::string& error);
    92             void debug(const std::string& error);
    93106
    94107            void pushCommandToQueue(const std::string& command);
     
    105118            std::string evalQuery(unsigned int querierID, const std::string& command);
    106119            std::string evalQuery(unsigned int querierID, unsigned int threadID, const std::string& command);
    107 
    108             virtual void tick(float dt);
    109 
    110             std::list<unsigned int> getThreadList() const;
    111 
    112         private:
    113             TclThreadManager();
    114             TclThreadManager(const TclThreadManager& other);
    115             ~TclThreadManager() {}
    116120
    117121            unsigned int threadCounter_;
  • code/trunk/src/core/XMLPort.h

    r1628 r1747  
    3232#include "CorePrereqs.h"
    3333
     34#include "util/Debug.h"
    3435#include "util/XMLIncludes.h"
    35 #include "util/MultiTypeMath.h"
     36#include "util/MultiType.h"
    3637#include "tinyxml/ticpp.h"
    3738#include "Executor.h"
    38 #include "Debug.h"
    3939#include "CoreIncludes.h"
    4040#include "BaseObject.h"
     
    4242
    4343#define XMLPortParam(classname, paramname, loadfunction, savefunction, xmlelement, mode) \
    44     XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode)
    45 #define XMLPortParam_Template(classname, paramname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode) \
    46     XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode)
     44    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode)
     45#define XMLPortParamTemplate(classname, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
     46    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode)
    4747
    4848#define XMLPortParamLoadOnly(classname, paramname, loadfunction, xmlelement, mode) \
    49     XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
    50 #define XMLPortParamLoadOnly_Template(classname, paramname, loadtemplate, loadfunction, xmlelement, mode) \
    51     XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, paramname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), 0, xmlelement, mode)
    52 
    53 #define XMLPortParamGeneric(containername, classname, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
    54     orxonox::XMLPortClassParamContainer<classname>* containername = (orxonox::XMLPortClassParamContainer<classname>*)(this->getIdentifier()->getXMLPortParamContainer(paramname)); \
     49    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode)
     50#define XMLPortParamLoadOnlyTemplate(classname, paramname, loadfunction, xmlelement, mode, ...) \
     51    XMLPortParamGeneric(xmlcontainer##loadfunction##0, classname, classname, this, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), 0, xmlelement, mode)
     52
     53#define XMLPortParamExtern(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode) \
     54    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, orxonox::createExecutor(orxonox::createFunctor(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction), xmlelement, mode);
     55#define XMLPortParamExternTemplate(classname, externclass, object, paramname, loadfunction, savefunction, xmlelement, mode, ...) \
     56    XMLPortParamGeneric(xmlcontainer##loadfunction##savefunction, classname, externclass, object, paramname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&externclass::loadfunction), std::string( #externclass ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&externclass::savefunction), std::string( #externclass ) + "::" + #savefunction), xmlelement, mode);
     57
     58#define XMLPortParamGeneric(containername, classname, objectclass, object, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
     59    orxonox::XMLPortClassParamContainer<objectclass>* containername = (orxonox::XMLPortClassParamContainer<objectclass>*)(ClassIdentifier<classname>::getIdentifier()->getXMLPortParamContainer(paramname)); \
    5560    if (!containername) \
    5661    { \
    57         containername = new orxonox::XMLPortClassParamContainer<classname>(std::string(paramname), loadexecutor, saveexecutor); \
    58         this->getIdentifier()->addXMLPortParamContainer(paramname, containername); \
     62        containername = new orxonox::XMLPortClassParamContainer<objectclass>(std::string(paramname), ClassIdentifier<classname>::getIdentifier(), loadexecutor, saveexecutor); \
     63        ClassIdentifier<classname>::getIdentifier()->addXMLPortParamContainer(paramname, containername); \
    5964    } \
    60     containername->port(this, xmlelement, mode)
     65    containername->port((BaseObject*)this, object, xmlelement, mode)
    6166
    6267
    6368#define XMLPortObject(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    64     XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    65 #define XMLPortObject_Template(classname, objectclass, sectionname, loadtemplate, loadfunction, savetemplate, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    66     XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor loadtemplate (&classname::loadfunction), #loadfunction), orxonox::createExecutor(orxonox::createFunctor savetemplate (&classname::savefunction), #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
     69    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
     70#define XMLPortObjectTemplate(classname, objectclass, sectionname, loadfunction, savefunction, xmlelement, mode, bApplyLoaderMask, bLoadBefore, ...) \
     71    XMLPortObjectGeneric(xmlcontainer##loadfunction##savefunction, classname, objectclass, sectionname, orxonox::createExecutor(orxonox::createFunctor< __VA_ARGS__ >(&classname::loadfunction), std::string( #classname ) + "::" + #loadfunction), orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction), xmlelement, mode, bApplyLoaderMask, bLoadBefore)
    6772
    6873#define XMLPortObjectGeneric(containername, classname, objectclass, sectionname, loadexecutor, saveexecutor, xmlelement, mode, bApplyLoaderMask, bLoadBefore) \
    69     orxonox::XMLPortClassObjectContainer<classname, objectclass>* containername = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(this->getIdentifier()->getXMLPortObjectContainer(sectionname)); \
     74    orxonox::XMLPortClassObjectContainer<classname, objectclass>* containername = (orxonox::XMLPortClassObjectContainer<classname, objectclass>*)(ClassIdentifier<classname>::getIdentifier()->getXMLPortObjectContainer(sectionname)); \
    7075    if (!containername) \
    7176    { \
    72         containername = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(std::string(sectionname), loadexecutor, saveexecutor, bApplyLoaderMask, bLoadBefore); \
    73         this->getIdentifier()->addXMLPortObjectContainer(sectionname, containername); \
     77        containername = new orxonox::XMLPortClassObjectContainer<classname, objectclass>(std::string(sectionname), ClassIdentifier<classname>::getIdentifier(), loadexecutor, saveexecutor, bApplyLoaderMask, bLoadBefore); \
     78        ClassIdentifier<classname>::getIdentifier()->addXMLPortObjectContainer(sectionname, containername); \
    7479    } \
    7580    containername->port(this, xmlelement, mode)
     
    102107            virtual const std::string& getDescription() = 0;
    103108
    104             virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiTypeMath& param) = 0;
    105             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1) = 0;
    106             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2) = 0;
    107             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) = 0;
    108             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) = 0;
    109             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) = 0;
     109            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param) = 0;
     110            virtual XMLPortParamContainer& defaultValues(const MultiType& param1) = 0;
     111            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2) = 0;
     112            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) = 0;
     113            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) = 0;
     114            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) = 0;
    110115
    111116        protected:
    112117            std::string paramname_;
    113118            ParseResult parseResult_;
    114 
     119            Identifier* identifier_;
     120            BaseObject* owner_;
    115121    };
    116122
     
    126132
    127133        public:
    128             XMLPortClassParamContainer(const std::string paramname, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor)
     134            XMLPortClassParamContainer(const std::string paramname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor)
    129135            {
    130136                this->paramname_ = paramname;
     137                this->identifier_ = identifier;
    131138                this->loadexecutor_ = loadexecutor;
    132139                this->saveexecutor_ = saveexecutor;
    133140            }
    134141
    135             XMLPortParamContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
    136             {
     142            XMLPortParamContainer& port(BaseObject* owner, T* object, Element& xmlelement, XMLPort::Mode mode)
     143            {
     144                this->owner_ = owner;
    137145                this->parseParams_.object = object;
    138146                this->parseParams_.xmlelement = &xmlelement;
     
    146154                        if ((attribute.size() > 0) || (this->loadexecutor_->allDefaultValuesSet()))
    147155                        {
    148                             COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << object->getIdentifier()->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")." << std::endl << ((BaseObject*)object)->getLoaderIndentation();
     156                            COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
    149157                            if (this->loadexecutor_->parse(object, attribute, ","))
    150158                                this->parseResult_ = PR_finished;
     
    158166                    {
    159167                        COUT(1) << std::endl;
    160                         COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << ((BaseObject*)object)->getLevelfile() << ":" << std::endl;
     168                        COUT(1) << "An error occurred in XMLPort.h while loading attribute '" << this->paramname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << this->owner_->getName() << ") in " << this->owner_->getLevelfile() << ":" << std::endl;
    161169                        COUT(1) << ex.what() << std::endl;
    162170                    }
     
    173181            }
    174182
    175             XMLPortParamContainer& port(const ParseParams& parseParams)
    176             {
    177                 return this->port(parseParams.object, *parseParams.xmlelement, parseParams.mode);
     183            XMLPortParamContainer& port(BaseObject* owner, const ParseParams& parseParams)
     184            {
     185                return this->port(owner, parseParams.object, *parseParams.xmlelement, parseParams.mode);
    178186            }
    179187
     
    181189            {
    182190                if (result == PR_waiting_for_default_values)
    183                     return this->port(params);
     191                    return this->port(this->owner_, params);
    184192                else
    185193                    return (*this);
     
    191199                { return this->loadexecutor_->getDescription(); }
    192200
    193             virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiTypeMath& param)
     201            virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param)
    194202            {
    195203                if (!this->loadexecutor_->defaultValueSet(index))
     
    197205                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
    198206            }
    199             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1)
     207            virtual XMLPortParamContainer& defaultValues(const MultiType& param1)
    200208            {
    201209                if (!this->loadexecutor_->defaultValueSet(0))
     
    203211                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
    204212            }
    205             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
     213            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2)
    206214            {
    207215                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)))
     
    209217                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
    210218            }
    211             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
     219            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3)
    212220            {
    213221                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)))
     
    215223                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
    216224            }
    217             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
     225            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4)
    218226            {
    219227                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)))
     
    221229                return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_);
    222230            }
    223             virtual XMLPortParamContainer& defaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
     231            virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5)
    224232            {
    225233                if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)) || (!this->loadexecutor_->defaultValueSet(4)))
     
    257265            bool bApplyLoaderMask_;
    258266            bool bLoadBefore_;
     267            Identifier* identifier_;
    259268    };
    260269
     
    263272    {
    264273        public:
    265             XMLPortClassObjectContainer(const std::string sectionname, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
     274            XMLPortClassObjectContainer(const std::string sectionname, Identifier* identifier, ExecutorMember<T>* loadexecutor, ExecutorMember<T>* saveexecutor, bool bApplyLoaderMask, bool bLoadBefore)
    266275            {
    267276                this->sectionname_ = sectionname;
     277                this->identifier_ = identifier;
    268278                this->loadexecutor_ = loadexecutor;
    269279                this->saveexecutor_ = saveexecutor;
     
    305315                                            {
    306316                                                newObject->XMLPort(*child, XMLPort::LoadObject);
    307                                                 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << object->getIdentifier()->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
     317                                                COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
    308318                                            }
    309319                                            else
    310320                                            {
    311                                                 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << object->getIdentifier()->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
     321                                                COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;
    312322                                            }
    313323
     
    336346                    {
    337347                        COUT(1) << std::endl;
    338                         COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << object->getIdentifier()->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
     348                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << object->getLevelfile() << ":" << std::endl;
    339349                        COUT(1) << ex.what() << std::endl;
    340350                    }
  • code/trunk/src/core/input/Button.cc

    r1535 r1747  
    3636#include "util/SubString.h"
    3737#include "util/String.h"
    38 #include "core/Debug.h"
     38#include "util/Debug.h"
    3939#include "core/ConsoleCommand.h"
    4040#include "core/CommandEvaluation.h"
  • code/trunk/src/core/input/InputManager.cc

    r1735 r1747  
    3939#include "core/CoreIncludes.h"
    4040#include "core/ConfigValueIncludes.h"
    41 #include "core/Debug.h"
    4241#include "core/CommandExecutor.h"
    4342#include "core/ConsoleCommand.h"
    4443#include "core/Shell.h"               // hack!
     44#include "util/Debug.h"
    4545
    4646#include "InputBuffer.h"
     
    321321    if (joySticksSize_)
    322322    {
    323       std::vector<MultiTypeMath> coeffPos;
    324       std::vector<MultiTypeMath> coeffNeg;
    325       std::vector<MultiTypeMath> zero;
     323      std::vector<double> coeffPos;
     324      std::vector<double> coeffNeg;
     325      std::vector<int> zero;
    326326      coeffPos.resize(24);
    327327      coeffNeg.resize(24);
     
    340340          getIdentifier()->addConfigValueContainer("CoeffPos", cont);
    341341      }
    342       cont->getValue(&coeffPos);
     342      cont->getValue(&coeffPos, this);
    343343
    344344      cont = getIdentifier()->getConfigValueContainer("CoeffNeg");
     
    348348          getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
    349349      }
    350       cont->getValue(&coeffNeg);
     350      cont->getValue(&coeffNeg, this);
    351351
    352352      cont = getIdentifier()->getConfigValueContainer("Zero");
     
    356356          getIdentifier()->addConfigValueContainer("Zero", cont);
    357357      }
    358       cont->getValue(&zero);
     358      cont->getValue(&zero, this);
    359359
    360360      // copy values to our own variables
  • code/trunk/src/core/input/KeyBinder.cc

    r1567 r1747  
    3636#include <string>
    3737#include "util/Convert.h"
    38 #include "core/Debug.h"
     38#include "util/Debug.h"
    3939#include "core/ConfigValueIncludes.h"
    4040#include "core/CoreIncludes.h"
     
    216216    if (!infile)
    217217    {
    218       ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "def_keybindings.ini");
    219       ConfigFileManager::getSingleton()->save(CFT_Keybindings, "keybindings.ini");
     218      ConfigFileManager::getInstance()->setFile(CFT_Keybindings, "def_keybindings.ini");
     219      ConfigFileManager::getInstance()->save(CFT_Keybindings, "keybindings.ini");
    220220    }
    221221    else
    222222      infile.close();
    223     ConfigFileManager::getSingleton()->setFile(CFT_Keybindings, "keybindings.ini");
     223    ConfigFileManager::getInstance()->setFile(CFT_Keybindings, "keybindings.ini");
    224224
    225225    // parse key bindings
     
    234234  void KeyBinder::setConfigValues()
    235235  {
    236     SetConfigValueGeneric(KeyBinder, analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
    237     SetConfigValueGeneric(KeyBinder, mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
    238     SetConfigValueGeneric(KeyBinder, bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
    239     SetConfigValueGeneric(KeyBinder, derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
    240     SetConfigValueGeneric(KeyBinder, mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
    241     SetConfigValueGeneric(KeyBinder, bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
     236    SetConfigValue(analogThreshold_, 0.05f)  .description("Threshold for analog axes until which the state is 0.");
     237    SetConfigValue(mouseSensitivity_, 1.0f)  .description("Mouse sensitivity.");
     238    SetConfigValue(bDeriveMouseInput_, false).description("Whether or not to derive moues movement for the absolute value.");
     239    SetConfigValue(derivePeriod_, 0.05f).description("Accuracy of the mouse input deriver. The higher the more precise, but laggier.");
     240    SetConfigValue(mouseSensitivityDerived_, 1.0f).description("Mouse sensitivity if mouse input is derived.");
     241    SetConfigValue(bClipMouse_, true).description("Whether or not to clip absolute value of mouse in non derive mode.");
    242242
    243243    float oldThresh = buttonThreshold_;
    244     SetConfigValueGeneric(KeyBinder, buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
     244    SetConfigValue(buttonThreshold_, 0.80f).description("Threshold for analog axes until which the button is not pressed.");
    245245    if (oldThresh != buttonThreshold_)
    246246      for (unsigned int i = 0; i < nHalfAxes_s; i++)
     
    268268    if (!cont)
    269269    {
    270       cont = new ConfigValueContainer(CFT_Keybindings, ClassIdentifier<KeyBinder>::getIdentifier(), button.name_, "");
     270      cont = new ConfigValueContainer(CFT_Keybindings, ClassIdentifier<KeyBinder>::getIdentifier(), button.name_, "", button.name_);
    271271      ClassIdentifier<KeyBinder>::getIdentifier()->addConfigValueContainer(button.name_, cont);
    272272    }
    273273    std::string old = button.bindingString_;
    274     cont->getValue(&button.bindingString_);
     274    cont->getValue(&button.bindingString_, this);
    275275
    276276    // keybinder stuff
  • code/trunk/src/core/input/KeyDetector.cc

    r1535 r1747  
    3333
    3434#include "KeyDetector.h"
    35 #include "core/Debug.h"
     35#include "util/Debug.h"
    3636#include "core/CoreIncludes.h"
    3737#include "core/CommandExecutor.h"
  • code/trunk/src/network/ClientConnection.cc

    r1534 r1747  
    4545
    4646#include "util/Sleep.h"
    47 #include "core/Debug.h"
     47#include "util/Debug.h"
    4848
    4949namespace network
     
    9191    return getPacket(address);
    9292  }*/
    93  
     93
    9494  ENetEvent *ClientConnection::getEvent(){
    9595    if(!buffer.isEmpty())
  • code/trunk/src/network/ConnectionManager.cc

    r1735 r1747  
    4545#include "core/CoreIncludes.h"
    4646#include "core/BaseObject.h"
     47#include "core/Iterator.h"
    4748#include "objects/SpaceShip.h"
    4849#include "util/Math.h"
     
    6667{
    6768  //boost::thread_group network_threads;
    68  
     69
    6970  ConnectionManager *ConnectionManager::instance_=0;
    70  
     71
    7172  ConnectionManager::ConnectionManager():receiverThread_(0){
    7273    assert(instance_==0);
     
    7778  }
    7879  boost::recursive_mutex ConnectionManager::enet_mutex;
    79  
     80
    8081//   ConnectionManager::ConnectionManager(ClientInformation *head) : receiverThread_(0) {
    8182//     assert(instance_==0);
     
    8586//     bindAddress.port = NETWORK_PORT;
    8687//   }
    87  
     88
    8889  ConnectionManager::ConnectionManager(int port){
    8990    assert(instance_==0);
     
    109110    bindAddress.port = NETWORK_PORT;
    110111  }
    111  
     112
    112113  ConnectionManager::~ConnectionManager(){
    113114    instance_=0;
     
    135136    return packet;
    136137  }*/
    137  
     138
    138139  ENetEvent *ConnectionManager::getEvent(){
    139140    if(!buffer.isEmpty())
     
    160161    return true;
    161162  }
    162  
     163
    163164//   bool ConnectionManager::addPacket(Packet::Packet *packet){
    164165//     ClientInformation *temp = instance_->head_->findClient(packet->getClientID());
     
    170171//     //  TODO: finish implementation
    171172//   }
    172 //   
    173  
     173//
     174
    174175  bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) {
    175176    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex);
     
    276277    }
    277278  }
    278  
     279
    279280  //### added some bugfixes here, but we cannot test them because
    280281  //### the server crashes everytime because of some gamestates
     
    335336
    336337  /**
    337    * 
    338    * @param clientID 
     338   *
     339   * @param clientID
    339340   */
    340341  void ConnectionManager::syncClassid(unsigned int clientID) {
     
    364365  }
    365366
    366  
    367  
     367
     368
    368369  bool ConnectionManager::removeShip(ClientInformation *client){
    369370    unsigned int id=client->getShipID();
    370     orxonox::Iterator<orxonox::SpaceShip> it;
    371     for(it = orxonox::ObjectList<orxonox::SpaceShip>::start(); it; ++it){
     371    orxonox::ObjectList<orxonox::SpaceShip>::iterator it;
     372    for(it = orxonox::ObjectList<orxonox::SpaceShip>::begin(); it; ++it){
    372373      if(it->objectID!=id)
    373374        continue;
     
    376377    return true;
    377378  }
    378  
    379  
     379
     380
    380381  void ConnectionManager::disconnectClient(ClientInformation *client){
    381382    {
     
    386387    removeShip(client);
    387388  }
    388  
     389
    389390
    390391}
  • code/trunk/src/network/GamestateClient.cc

    r1735 r1747  
    3333#include "core/CoreIncludes.h"
    3434#include "core/BaseObject.h"
     35#include "core/Iterator.h"
    3536#include "Synchronisable.h"
    3637
     
    6869    return true;
    6970  }
    70  
     71
    7172  int GamestateClient::processGamestates(){
    7273    if(tempGamestate_==NULL)
     
    8990  * @return iterator pointing to the next object in the list
    9091  */
    91   void GamestateClient::removeObject(orxonox::Iterator<Synchronisable> &it) {
    92     orxonox::Iterator<Synchronisable> temp=it;
     92  void GamestateClient::removeObject(orxonox::ObjectList<Synchronisable>::iterator &it) {
     93    orxonox::ObjectList<Synchronisable>::iterator temp=it;
    9394    ++it;
    9495    delete  *temp;
  • code/trunk/src/network/GamestateClient.h

    r1735 r1747  
    4242
    4343#include <map>
    44 // 
     44//
    4545#include "NetworkPrereqs.h"
    4646#include "core/CorePrereqs.h"
     
    5858    GamestateClient();
    5959    ~GamestateClient();
    60    
     60
    6161    bool add(packet::Gamestate *gs, int clientID);
    6262    bool ack(int gamestateID, int clientID);
    63    
     63
    6464    int processGamestates();
    6565    packet::Gamestate *getGamestate();
     
    6767  private:
    6868    bool processGamestate(packet::Gamestate *gs);
    69     void removeObject(orxonox::Iterator<Synchronisable> &it);
     69    void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
    7070    void printGamestateMap();
    7171    bool saveShipCache();
     
    7878    orxonox::SpaceShip *myShip_;
    7979    unsigned char *shipCache_;
    80    
     80
    8181  };
    8282
  • code/trunk/src/network/Server.cc

    r1735 r1747  
    5050#include "objects/SpaceShip.h"
    5151#include "core/ConsoleCommand.h"
     52#include "core/Iterator.h"
    5253#include "packet/Chat.h"
    5354#include "packet/Packet.h"
     
    5859  #define MAX_FAILURES 20;
    5960  #define NETWORK_FREQUENCY 30
    60  
     61
    6162  /**
    6263  * Constructor for default values (bindaddress is set to ENET_HOST_ANY
     
    6869    gamestates_ = new GamestateManager();
    6970  }
    70  
     71
    7172  Server::Server(int port){
    7273    timeSinceLastUpdate_=0;
     
    123124    return message->process();
    124125  }
    125  
     126
    126127  /**
    127128  * This function sends out a message to all clients
     
    175176    return;
    176177  }
    177  
     178
    178179  bool Server::queuePacket(ENetPacket *packet, int clientID){
    179180    return connection->addPacket(packet, clientID);
     
    230231    return p->process();
    231232  }
    232  
     233
    233234  /**
    234235  * sends the gamestate
     
    261262      assert(gs->compressData());
    262263      if ( !gs->send() ){
    263         COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->getFailures() << std::endl; 
     264        COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->getFailures() << std::endl;
    264265        temp->addFailure();
    265266      }else
     
    276277    return true;
    277278  }
    278  
     279
    279280//   void Server::processChat( chat *data, int clientId){
    280281//     char *message = new char [strlen(data->message)+10+1];
     
    286287//     delete data;
    287288//   }
    288  
     289
    289290  bool Server::addClient(ENetEvent *event){
    290291    ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
     
    303304    return createClient(temp->getID());
    304305  }
    305  
     306
    306307  bool Server::createClient(int clientID){
    307308    ClientInformation *temp = ClientInformation::findClient(clientID);
     
    325326    return true;
    326327  }
    327  
     328
    328329  bool Server::createShip(ClientInformation *client){
    329330    if(!client)
     
    351352    no->create();
    352353    no->setBacksync(true);
    353    
     354
    354355    return true;
    355356  }
    356  
     357
    357358  bool Server::disconnectClient(ENetEvent *event){
    358359    COUT(4) << "removing client from list" << std::endl;
    359360    //return removeClient(head_->findClient(&(peer->address))->getID());
    360    
     361
    361362    //boost::recursive_mutex::scoped_lock lock(head_->mutex_);
    362     orxonox::Iterator<orxonox::SpaceShip> it = orxonox::ObjectList<orxonox::SpaceShip>::start();
     363    orxonox::ObjectList<orxonox::SpaceShip>::iterator it = orxonox::ObjectList<orxonox::SpaceShip>::begin();
    363364    ClientInformation *client = ClientInformation::findClient(&event->peer->address);
    364365    if(!client)
     
    369370        continue;
    370371      }
    371       orxonox::Iterator<orxonox::SpaceShip> temp=it;
     372      orxonox::ObjectList<orxonox::SpaceShip>::iterator temp=it;
    372373      ++it;
    373374      delete  *temp;
     
    386387    gamestates_->removeClient(client);
    387388  }
    388  
     389
    389390}
  • code/trunk/src/network/Synchronisable.h

    r1735 r1747  
    9292    Synchronisable();
    9393  private:
    94     /*  bool removeObject(Iterator<Synchronisable> it);*/
     94    /*  bool removeObject(ObjectList<Synchronisable>::iterator it);*/
    9595
    9696    std::list<synchronisableVariable *> *syncList;
  • code/trunk/src/network/packet/Gamestate.cc

    r1740 r1747  
    3030#include "network/ClientInformation.h"
    3131#include "network/GamestateHandler.h"
     32#include "core/Iterator.h"
    3233
    3334#include <zlib.h>
     
    7980  unsigned char *mem=data_;
    8081  mem+=sizeof(GamestateHeader);
    81   orxonox::Iterator<Synchronisable> it;
    82   for(it = orxonox::ObjectList<Synchronisable>::start(); it; ++it){
     82  orxonox::ObjectList<Synchronisable>::iterator it;
     83  for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
    8384    tempsize=it->getSize2(mode);
    8485
     
    8687      // start allocate additional memory
    8788      COUT(3) << "G.St.Man: need additional memory" << std::endl;
    88       orxonox::Iterator<Synchronisable> temp = it;
     89      orxonox::ObjectList<Synchronisable>::iterator temp = it;
    8990      int addsize=tempsize;
    9091      while(++temp)
     
    124125  unsigned char *mem=data_+sizeof(GamestateHeader);
    125126    // get the start of the Synchronisable list
    126   orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
     127  orxonox::ObjectList<Synchronisable>::iterator it=orxonox::ObjectList<Synchronisable>::begin();
    127128
    128129  while(mem < data_+sizeof(GamestateHeader)+HEADER->normsize){
     
    318319  int size=0;
    319320    // get the start of the Synchronisable list
    320   orxonox::Iterator<Synchronisable> it;
     321  orxonox::ObjectList<Synchronisable>::iterator it;
    321322    // get total size of gamestate
    322   for(it = orxonox::ObjectList<Synchronisable>::start(); it; ++it)
     323  for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it)
    323324    size+=it->getSize2(mode); // size of the actual data of the synchronisable
    324325//  size+=sizeof(GamestateHeader);
     
    331332 * @return iterator pointing to the next object in the list
    332333 */
    333   void Gamestate::removeObject(orxonox::Iterator<Synchronisable> &it) {
    334     orxonox::Iterator<Synchronisable> temp=it;
     334  void Gamestate::removeObject(orxonox::ObjectList<Synchronisable>::iterator &it) {
     335    orxonox::ObjectList<Synchronisable>::iterator temp=it;
    335336    ++it;
    336337    delete  *temp;
  • code/trunk/src/network/packet/Gamestate.h

    r1735 r1747  
    3838
    3939namespace packet {
    40  
     40
    4141struct GamestateHeader{
    4242  ENUM::Type packetType;
     
    5151
    5252/**
    53         @author 
     53        @author
    5454*/
    5555class Gamestate: public Packet{
     
    5757    Gamestate();
    5858    Gamestate(unsigned char *data, int clientID);
    59    
     59
    6060    ~Gamestate();
    61    
     61
    6262    bool collectData(int id, int mode=0x0);
    6363    bool spreadData(int mode=0x0);
     
    6969    bool compressData();
    7070    bool decompressData();
    71    
     71
    7272    // Packet functions
    7373    virtual unsigned int getSize() const;
    7474    virtual bool process();
    7575
    76    
     76
    7777  private:
    7878    unsigned int calcGamestateSize(int mode=0x0);
    79     void removeObject(orxonox::Iterator<Synchronisable> &it);
     79    void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
    8080
    81    
     81
    8282    //Bytestream *bs_;
    8383    //GamestateHeader *header_;
  • code/trunk/src/orxonox/CMakeLists.txt

    r1625 r1747  
    77  RadarViewable.cc
    88  Settings.cc
     9  SignalHandler.cc
    910
    1011  overlays/OrxonoxOverlay.cc
  • code/trunk/src/orxonox/GraphicsEngine.cc

    r1625 r1747  
    4747#include "core/CoreIncludes.h"
    4848#include "core/ConfigValueIncludes.h"
    49 #include "core/Debug.h"
     49#include "core/Iterator.h"
    5050#include "core/CommandExecutor.h"
    5151#include "core/ConsoleCommand.h"
     52#include "util/Debug.h"
    5253
    5354#include "overlays/console/InGameConsole.h"
     
    9798    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
    9899
    99     unsigned int old = this->detailLevelParticle_;
    100     SetConfigValue(detailLevelParticle_, 2).description("O: off, 1: low, 2: normal, 3: high");
    101 
    102     if (this->detailLevelParticle_ != old)
    103       for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it)
    104         it->detailLevelChanged(this->detailLevelParticle_);
     100    SetConfigValue(detailLevelParticle_, 2).description("O: off, 1: low, 2: normal, 3: high").callback(this, &GraphicsEngine::detailLevelParticleChanged);
     101  }
     102
     103  void GraphicsEngine::detailLevelParticleChanged()
     104  {
     105    for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)
     106      it->detailLevelChanged(this->detailLevelParticle_);
    105107  }
    106108
     
    441443  void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw)
    442444  {
    443     for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
     445    for (ObjectList<orxonox::WindowEventListener>::iterator it = ObjectList<orxonox::WindowEventListener>::begin(); it; ++it)
    444446      it->windowMoved();
    445447  }
     
    453455  void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)
    454456  {
    455     for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
     457    for (ObjectList<orxonox::WindowEventListener>::iterator it = ObjectList<orxonox::WindowEventListener>::begin(); it; ++it)
    456458      it->windowResized(this->renderWindow_->getWidth(), this->renderWindow_->getHeight());
    457459  }
     
    463465  void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw)
    464466  {
    465     for (Iterator<orxonox::WindowEventListener> it = ObjectList<orxonox::WindowEventListener>::start(); it; ++it)
     467    for (ObjectList<orxonox::WindowEventListener>::iterator it = ObjectList<orxonox::WindowEventListener>::begin(); it; ++it)
    466468      it->windowFocusChanged();
    467469  }
  • code/trunk/src/orxonox/GraphicsEngine.h

    r1625 r1747  
    5656        public:
    5757            void setConfigValues();
     58            void detailLevelParticleChanged();
    5859            bool setup();
    5960            bool declareRessourceLocations();
  • code/trunk/src/orxonox/Main.cc

    r1535 r1747  
    3737
    3838#include "util/OrxonoxPlatform.h"
    39 #include "core/SignalHandler.h"
     39#include "SignalHandler.h"
    4040#include "Orxonox.h"
    4141
  • code/trunk/src/orxonox/Orxonox.cc

    r1735 r1747  
    5454// core
    5555#include "core/ConfigFileManager.h"
     56#include "core/Iterator.h"
    5657#include "core/ConsoleCommand.h"
    57 #include "core/Debug.h"
    5858#include "core/Loader.h"
    5959#include "core/input/InputManager.h"
    6060#include "core/TclBind.h"
    6161#include "core/Core.h"
     62#include "util/Debug.h"
    6263
    6364// audio
     
    8586namespace orxonox
    8687{
    87   SetConsoleCommandShortcut(Orxonox, exit).setKeybindMode(KeybindMode::OnPress);
    88   SetConsoleCommandShortcut(Orxonox, slomo).setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0).setAxisParamIndex(0).setIsAxisRelative(false);
    89   SetConsoleCommandShortcut(Orxonox, setTimeFactor).setAccessLevel(AccessLevel::Offline).setDefaultValue(0, 1.0);
     88  SetConsoleCommandShortcut(Orxonox, exit).keybindMode(KeybindMode::OnPress);
     89  SetConsoleCommandShortcut(Orxonox, slomo).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0).axisParamIndex(0).isAxisRelative(false);
     90  SetConsoleCommandShortcut(Orxonox, setTimeFactor).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
    9091
    9192  /**
     
    181182    float change = factor / Orxonox::getSingleton()->getTimeFactor();
    182183    Orxonox::getSingleton()->timefactor_ = factor;
    183     for (Iterator<ParticleInterface> it = ObjectList<ParticleInterface>::begin(); it; ++it)
     184    for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)
    184185        it->setSpeedFactor(it->getSpeedFactor() * change);
    185186
     
    197198  {
    198199#ifdef _DEBUG
    199     ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox_d.ini");
     200    ConfigFileManager::getInstance()->setFile(CFT_Settings, "orxonox_d.ini");
    200201#else
    201     ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
     202    ConfigFileManager::getInstance()->setFile(CFT_Settings, "orxonox.ini");
    202203#endif
    203204    Factory::createClassHierarchy();
     
    442443
    443444    unsigned long frameCount = 0;
    444    
     445
    445446    // TODO: this would very well fit into a configValue
    446447    const unsigned long refreshTime = 200000;
     
    468469
    469470      // Call those objects that need the real time
    470       for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
     471      for (ObjectList<TickableReal>::iterator it = ObjectList<TickableReal>::begin(); it; ++it)
    471472        it->tick(dt);
    472473      // Call the scene objects
    473       for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
     474      for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
    474475        it->tick(dt * this->timefactor_);
    475476
  • code/trunk/src/orxonox/OrxonoxStableHeaders.h

    r1631 r1747  
    9292
    9393#include "util/Convert.h"
     94#include "util/Debug.h"
    9495#include "util/Math.h"
    9596#include "util/Multitype.h"
    96 #include "util/MultiTypeMath.h"
     97#include "util/OutputBuffer.h"
     98#include "util/OutputHandler.h"
    9799#include "util/Sleep.h"
    98100#include "util/String.h"
     
    104106#include "core/CoreIncludes.h"
    105107#include "core/ConfigValueIncludes.h"
    106 #include "core/Debug.h"
    107 #include "core/OutputBuffer.h"
    108 #include "core/OutputHandler.h"
    109108#include "core/Executor.h"
    110109#include "core/XMLPort.h"
  • code/trunk/src/orxonox/Radar.cc

    r1625 r1747  
    3939#include "core/CoreIncludes.h"
    4040#include "core/ConsoleCommand.h"
     41#include "core/Iterator.h"
    4142#include "RadarListener.h"
    4243
    4344namespace orxonox
    4445{
    45     SetConsoleCommand(Radar, cycleNavigationFocus, true).setAccessLevel(AccessLevel::User);
    46     SetConsoleCommand(Radar, releaseNavigationFocus, true).setAccessLevel(AccessLevel::User);
     46    SetConsoleCommand(Radar, cycleNavigationFocus, true).accessLevel(AccessLevel::User);
     47    SetConsoleCommand(Radar, releaseNavigationFocus, true).accessLevel(AccessLevel::User);
    4748
    4849    Radar* Radar::instance_s = 0;
     
    106107        }
    107108
    108         for (Iterator<RadarListener> itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
     109        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    109110        {
    110111            (*itListener)->radarTick(dt);
    111112
    112             for (Iterator<RadarViewable> itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
     113            for (ObjectList<RadarViewable>::iterator itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
    113114            {
    114115                if ((*itElement) != SpaceShip::getLocalShip() && (*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage())
     
    120121    void Radar::cycleFocus()
    121122    {
    122         if (*(ObjectList<RadarViewable>::begin()) == 0)
     123        if (ObjectList<RadarViewable>::begin() == 0)
    123124        {
    124125            // list is empty
     
    137138            float nextDistance = FLT_MAX;
    138139            float minimumDistance = FLT_MAX;
    139             Iterator<RadarViewable> itFallback = 0;
    140 
    141             for (Iterator<RadarViewable> it = ObjectList<RadarViewable>::begin(); it; ++it)
     140            ObjectList<RadarViewable>::iterator itFallback = 0;
     141
     142            for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it)
    142143            {
    143144                if (*it == SpaceShip::getLocalShip())
     
    181182        // iterate through all Radar Objects
    182183        unsigned int i = 0;
    183         for (Iterator<RadarViewable> it = ObjectList<RadarViewable>::start(); it; ++it, ++i)
     184        for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
    184185        {
    185186            COUT(3) << i++ << ": " << (*it)->getWorldPosition() << std::endl;
  • code/trunk/src/orxonox/Radar.h

    r1625 r1747  
    5555        RadarBase() { }
    5656    };
    57  
     57
    5858    class _OrxonoxExport Radar : public Tickable, private virtual RadarBase
    5959    {
     
    6161        Radar();
    6262        ~Radar();
     63
     64        virtual void tick(float dt);
    6365
    6466        const RadarViewable* getFocus();
     
    7577    private:
    7678        Radar(Radar& instance);
    77         void tick(float dt);
    7879
    7980        void releaseFocus();
     
    8182        void cycleFocus();
    8283
    83         Iterator<RadarViewable> itFocus_;
     84        ObjectListIterator<RadarViewable> itFocus_;
    8485        RadarViewable* focus_;
    8586        std::map<std::string, RadarViewable::Shape> objectTypes_;
    86         int objectTypeCounter_; 
     87        int objectTypeCounter_;
    8788
    8889        static Radar* instance_s;
  • code/trunk/src/orxonox/RadarViewable.cc

    r1625 r1747  
    2929#include "OrxonoxStableHeaders.h"
    3030#include "RadarViewable.h"
    31 #include "core/Debug.h"
     31#include "util/Debug.h"
    3232#include "core/CoreIncludes.h"
    3333#include "objects/WorldEntity.h"
  • code/trunk/src/orxonox/RadarViewable.h

    r1625 r1747  
    3333#include <string>
    3434#include "util/Math.h"
    35 #include "core/Debug.h"
     35#include "util/Debug.h"
    3636#include "core/OrxonoxClass.h"
    3737
  • code/trunk/src/orxonox/Settings.cc

    r1535 r1747  
    6868  void Settings::setConfigValues()
    6969  {
    70     SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.");
     70    SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.").callback(this, &Settings::dataPathChanged);
     71  }
     72
     73  /**
     74    @brief Callback function if the datapath has changed.
     75  */
     76  void Settings::dataPathChanged()
     77  {
    7178    if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/')
    7279    {
  • code/trunk/src/orxonox/Settings.h

    r1535 r1747  
    4848    public:
    4949      void setConfigValues();
     50      void dataPathChanged();
    5051
    5152      static const std::string& getDataPath();
  • code/trunk/src/orxonox/objects/Ambient.cc

    r1625 r1747  
    3939#include "util/Convert.h"
    4040#include "util/Math.h"
    41 #include "core/Debug.h"
     41#include "util/Debug.h"
    4242#include "core/CoreIncludes.h"
    43 #include "GraphicsEngine.h"
    4443#include "core/XMLPort.h"
    4544#include "core/ConsoleCommand.h"
     45#include "GraphicsEngine.h"
    4646
    4747namespace orxonox
    4848{
    49     SetConsoleCommand(Ambient, setAmbientLightTest, false).setDefaultValues(ColourValue(1, 1, 1, 1)).setAccessLevel(AccessLevel::Offline);
     49    SetConsoleCommandAlias(Ambient, setAmbientLightTest, "setAmbientLight", false).defaultValues(ColourValue(1, 1, 1, 1)).accessLevel(AccessLevel::Offline);
    5050
    5151    CreateFactory(Ambient);
     
    6464    }
    6565
    66     bool Ambient::create(){
    67       GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
    68       return Synchronisable::create();
     66    bool Ambient::create()
     67    {
     68        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
     69        return Synchronisable::create();
    6970    }
    70    
    71     void Ambient::registerAllVariables(){
    72       registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    73      
     71
     72    void Ambient::registerAllVariables()
     73    {
     74        registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
    7475    }
    7576
    7677    void Ambient::setAmbientLight(const ColourValue& colour)
    7778    {
    78             GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    79       ambientLight_=colour;     
     79        GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
     80        ambientLight_=colour;
    8081    }
    8182
     
    8889    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    8990    {
    90         BaseObject::XMLPort(xmlelement, mode);
     91        SUPER(Ambient, XMLPort, xmlelement, mode);
    9192
    92         XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     93        XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
    9394        create();
    9495    }
  • code/trunk/src/orxonox/objects/Ambient.h

    r1735 r1747  
    4545
    4646            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    47             void setAmbientLight(const ColourValue& colour);
    4847            virtual bool create();
    4948            void registerAllVariables();
     49
     50            void setAmbientLight(const ColourValue& colour);
     51            inline const ColourValue& getAmbienetLight() const
     52                { return this->ambientLight_; }
    5053
    5154            static void setAmbientLightTest(const ColourValue& colour)
  • code/trunk/src/orxonox/objects/Backlight.cc

    r1608 r1747  
    103103    void Backlight::tick(float dt)
    104104    {
    105         WorldEntity::tick(dt);
     105        SUPER(Backlight, tick, dt);
    106106
    107107        if (this->isActive())
     
    147147    void Backlight::changedVisibility()
    148148    {
    149         WorldEntity::changedVisibility();
     149        SUPER(Backlight, changedVisibility);
    150150
    151151        this->billboard_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/BillboardProjectile.cc

    r1559 r1747  
    6363    void BillboardProjectile::changedVisibility()
    6464    {
    65         Projectile::changedVisibility();
     65        SUPER(BillboardProjectile, changedVisibility);
    6666        this->billboard_.setVisible(this->isVisible());
    6767    }
  • code/trunk/src/orxonox/objects/Camera.cc

    r1505 r1747  
    4242#include "util/Convert.h"
    4343#include "util/Math.h"
    44 #include "core/Debug.h"
     44#include "util/Debug.h"
    4545#include "core/CoreIncludes.h"
    4646#include "GraphicsEngine.h"
  • code/trunk/src/orxonox/objects/Model.cc

    r1627 r1747  
    6565    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6666    {
    67         WorldEntity::XMLPort(xmlelement, mode);
     67        SUPER(Model, XMLPort, xmlelement, mode);
    6868
    69         XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
     69        XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode);
    7070
    7171        Model::create();
    72     }
    73 
    74     void Model::setMesh(const std::string& meshname)
    75     {
    76         this->meshSrc_ = meshname;
    7772    }
    7873
     
    9893    void Model::changedVisibility()
    9994    {
    100         WorldEntity::changedVisibility();
     95        SUPER(Model, changedVisibility);
    10196        if (this->isInitialized())
    10297            this->mesh_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/Model.h

    r1558 r1747  
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    4646            virtual void changedVisibility();
    47             void setMesh(const std::string& meshname);
     47            inline void setMesh(const std::string& meshname)
     48                { this->meshSrc_ = meshname; }
     49            inline const std::string& getMesh() const
     50                { return this->meshSrc_; }
    4851            virtual bool create();
    4952
  • code/trunk/src/orxonox/objects/NPC.cc

    r1625 r1747  
    3131
    3232#include "core/CoreIncludes.h"
     33#include "core/Iterator.h"
    3334
    3435namespace orxonox {
     
    5657    movable_ = movable;
    5758  }
    58  
     59
    5960  void NPC::registerAllVariables(){
    6061    Model::registerAllVariables();
    6162    registerVar(&movable_, sizeof(movable_), network::DATA);
    6263  }
    63  
     64
    6465
    6566  /**
     
    112113    int numberOfNeighbour = 0;  //number of observed neighbours
    113114    float distance = 0;  // distance to the actual element
    114     for(Iterator<WorldEntity> it = ObjectList<WorldEntity>::start(); it; ++it) {  //go through all elements
     115    for(ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it; ++it) {  //go through all elements
    115116      distance = getDistance(*it);  //get distance between this and actual
    116117      if ((distance > 0) && (distance < SEPERATIONDISTANCE)) {  //do only if actual is inside detectionradius
     
    139140    //float distance = 0;
    140141    //go through all elements
    141     for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
     142    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
    142143      float distance = getDistance(*it);  //get distance between this and actual
    143144      if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) {  //check if actual element is inside detectionradius
     
    159160    //float distance = 0;
    160161    //go through all elements
    161     for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it) {  //just working with 3 elements at the moment
     162    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
    162163      float distance = getDistance(*it);  //get distance between this and actual
    163164      if ((distance > 0) && (distance < COHESIONDISTANCE)) {  //check if actual element is inside detectionradius
  • code/trunk/src/orxonox/objects/NPC.h

    r1625 r1747  
    4848      NPC();
    4949      virtual ~NPC();
    50       void tick(float dt);
     50      virtual void tick(float dt);
    5151      void update();
    5252      void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
  • code/trunk/src/orxonox/objects/ParticleProjectile.cc

    r1563 r1747  
    3232#include "SpaceShip.h"
    3333#include "core/CoreIncludes.h"
     34#include "core/ConfigValueIncludes.h"
    3435
    3536namespace orxonox
     
    5253            this->particles_ = 0;
    5354        }
     55
     56        this->setConfigValues();
    5457    }
    5558
     
    6063    }
    6164
     65    void ParticleProjectile::setConfigValues()
     66    {
     67        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
     68    }
     69
    6270    void ParticleProjectile::changedVisibility()
    6371    {
    64         BillboardProjectile::changedVisibility();
     72        SUPER(ParticleProjectile, changedVisibility);
    6573        this->particles_->setEnabled(this->isVisible());
    6674    }
  • code/trunk/src/orxonox/objects/ParticleProjectile.h

    r1558 r1747  
    4444            virtual ~ParticleProjectile();
    4545            virtual void changedVisibility();
     46            void setConfigValues();
    4647
    4748        private:
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1602 r1747  
    3535#include "core/Executor.h"
    3636#include "core/ConfigValueIncludes.h"
     37#include "core/Iterator.h"
    3738#include "tools/ParticleInterface.h"
    3839
     
    4344namespace orxonox
    4445{
    45     float Projectile::speed_ = 5000;
     46    float Projectile::speed_s = 5000;
    4647
    4748    Projectile::Projectile(SpaceShip* owner) : owner_(owner)
     
    7374        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
    7475        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
    75         SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second");
     76        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(this, &Projectile::speedChanged);
     77    }
    7678
    77         if(this->owner_)
    78           this->setVelocity(this->owner_->getInitialDir() * this->speed_);
     79    void Projectile::speedChanged()
     80    {
     81        Projectile::speed_s = this->speed_;
     82        if (this->owner_)
     83            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
    7984    }
    8085
    8186    void Projectile::tick(float dt)
    8287    {
    83         WorldEntity::tick(dt);
     88        SUPER(Projectile, tick, dt);
    8489
    8590        if (!this->isActive())
     
    8792
    8893        float radius;
    89         for (Iterator<Model> it = ObjectList<Model>::start(); it; ++it)
     94        for (ObjectList<Model>::iterator it = ObjectList<Model>::begin(); it; ++it)
    9095        {
    9196            if ((*it) != this->owner_)
    9297            {
    93                 radius = it->getScale().x * 3.0;
     98                radius = it->getScale3D().x * 3.0;
    9499
    95100                if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
  • code/trunk/src/orxonox/objects/Projectile.h

    r1552 r1747  
    4242            virtual ~Projectile();
    4343            void setConfigValues();
     44            void speedChanged();
    4445            void destroyObject();
    4546            virtual void tick(float dt);
    4647
    4748            static float getSpeed()
    48                 { return Projectile::speed_; }
     49                { return Projectile::speed_s; }
    4950
    5051        protected:
     
    5556            std::string explosionTemplateName_;
    5657            std::string smokeTemplateName_;
    57             static float speed_;
     58        protected:
     59            static float speed_s;
     60            float speed_;
     61        private:
    5862            float lifetime_;
    5963            float damage_;
  • code/trunk/src/orxonox/objects/RotatingProjectile.cc

    r1558 r1747  
    6565    void RotatingProjectile::setConfigValues()
    6666    {
    67         SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0));
     67        SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0)).callback(this, &RotatingProjectile::colourChanged);
     68    }
    6869
    69         this->rotatingBillboard1_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
    70         this->rotatingBillboard2_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     70    void RotatingProjectile::colourChanged()
     71    {
     72        if (this->isInitialized())
     73        {
     74            this->rotatingBillboard1_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     75            this->rotatingBillboard2_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
     76        }
    7177    }
    7278
     
    8187        }
    8288
    83         Projectile::tick(dt);
     89        SUPER(RotatingProjectile, tick, dt);
    8490    }
    8591
    8692    void RotatingProjectile::changedVisibility()
    8793    {
    88         BillboardProjectile::changedVisibility();
     94        SUPER(RotatingProjectile, changedVisibility);
    8995        this->rotatingBillboard1_.setVisible(this->isVisible());
    9096        this->rotatingBillboard2_.setVisible(this->isVisible());
  • code/trunk/src/orxonox/objects/RotatingProjectile.h

    r1558 r1747  
    1414            virtual ~RotatingProjectile();
    1515            void setConfigValues();
     16            void colourChanged();
    1617            virtual void tick(float dt);
    1718            virtual void changedVisibility();
  • code/trunk/src/orxonox/objects/Skybox.cc

    r1558 r1747  
    3737#include "GraphicsEngine.h"
    3838#include "core/CoreIncludes.h"
    39 #include "core/Debug.h"
    4039#include "core/XMLPort.h"
     40#include "util/Debug.h"
    4141
    4242namespace orxonox
     
    5959    }
    6060
    61     void Skybox::setSkyboxSrc(const std::string& src)
    62     {
    63         this->skyboxSrc_ = src;
    64     }
    65 
    6661    /**
    6762        @brief XML loading and saving.
     
    7267    void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7368    {
    74         BaseObject::XMLPort(xmlelement, mode);
     69        SUPER(Skybox, XMLPort, xmlelement, mode);
    7570
    76         XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, mode);
     71        XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode);
    7772        create();
    7873    }
     
    9186    void Skybox::changedVisibility()
    9287    {
    93         BaseObject::changedVisibility();
     88        SUPER(Skybox, changedVisibility);
    9489        GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
    9590    }
  • code/trunk/src/orxonox/objects/Skybox.h

    r1558 r1747  
    4949            virtual bool create();
    5050            void registerAllVariables();
    51             void setSkyboxSrc(const std::string &src);
     51
     52            inline void setSkyboxSrc(const std::string &src)
     53                { this->skyboxSrc_ = src; }
     54            inline const std::string& getSkyboxSrc() const
     55                { return this->skyboxSrc_; }
    5256
    5357        private:
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1735 r1747  
    3737#include "util/Convert.h"
    3838#include "util/Math.h"
    39 
     39#include "util/Debug.h"
    4040#include "core/CoreIncludes.h"
    4141#include "core/ConfigValueIncludes.h"
    42 #include "core/Debug.h"
     42#include "core/Iterator.h"
     43#include "core/input/InputManager.h"
    4344#include "core/XMLPort.h"
    4445#include "core/ConsoleCommand.h"
    45 #include "network/Host.h"
    46 
    4746#include "tools/ParticleInterface.h"
    48 
    49 #include "GraphicsEngine.h"
     47#include "network/Client.h"
     48#include "Backlight.h"
     49#include "CameraHandler.h"
     50#include "ParticleSpawner.h"
    5051#include "RotatingProjectile.h"
    5152#include "ParticleProjectile.h"
    52 #include "ParticleSpawner.h"
    53 #include "Backlight.h"
    54 #include "CameraHandler.h"
     53#include "GraphicsEngine.h"
    5554
    5655namespace orxonox
    5756{
    58     SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).setAccessLevel(AccessLevel::Debug);
    59     SetConsoleCommand(SpaceShip, whereAmI, true).setAccessLevel(AccessLevel::User);
    60     SetConsoleCommand(SpaceShip, moveLongitudinal, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    61     SetConsoleCommand(SpaceShip, moveLateral, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    62     SetConsoleCommand(SpaceShip, moveYaw, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    63     SetConsoleCommand(SpaceShip, movePitch, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    64     SetConsoleCommand(SpaceShip, moveRoll, true).setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);
    65     SetConsoleCommand(SpaceShip, fire, true).setAccessLevel(AccessLevel::User).setKeybindMode(KeybindMode::OnHold);
    66     SetConsoleCommandGeneric(test1, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxSpeed"), false).setAccessLevel(AccessLevel::Debug);
    67     SetConsoleCommandGeneric(test2, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxBlubber"), false).setAccessLevel(AccessLevel::Debug);
    68     SetConsoleCommandGeneric(test3, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setRofl"), false).setAccessLevel(AccessLevel::Debug);
     57    SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).accessLevel(AccessLevel::Debug);
     58    SetConsoleCommand(SpaceShip, whereAmI, true).accessLevel(AccessLevel::User);
     59    SetConsoleCommand(SpaceShip, moveLongitudinal, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     60    SetConsoleCommand(SpaceShip, moveLateral, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     61    SetConsoleCommand(SpaceShip, moveYaw, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     62    SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     63    SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
     64    SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold);
     65    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug);
     66    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug);
     67    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setRofl", 3, false).accessLevel(AccessLevel::Debug);
    6968
    7069    CreateFactory(SpaceShip);
     
    7473
    7574    SpaceShip *SpaceShip::getLocalShip(){
    76       Iterator<SpaceShip> it;
    77       for(it = ObjectList<SpaceShip>::start(); it; ++it){
     75      ObjectList<SpaceShip>::iterator it;
     76      for(it = ObjectList<SpaceShip>::begin(); it; ++it){
    7877        if( (it)->myShip_ )
    7978          return *it;
     
    289288    void SpaceShip::changedVisibility()
    290289    {
    291         Model::changedVisibility();
     290        SUPER(SpaceShip, changedVisibility);
    292291
    293292        this->tt1_->setEnabled(this->isVisible());
     
    306305    void SpaceShip::changedActivity()
    307306    {
    308         Model::changedActivity();
     307        SUPER(SpaceShip, changedActivity);
    309308
    310309        this->tt1_->setEnabled(this->isVisible());
     
    392391    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    393392    {
    394         Model::XMLPort(xmlelement, mode);
    395 
    396         XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);
    397         XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);
    398         XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);
    399         XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);
    400         XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);
    401         XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);
    402         XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
    403         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
     393        SUPER(SpaceShip, XMLPort, xmlelement, mode);
     394
     395        XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
     396        XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode);
     397        XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode);
     398        XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode);
     399        XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode);
     400        XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode);
     401        XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode);
     402        XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode);
    404403
    405404        myShip_=true; //TODO: this is a hack
     
    535534
    536535
    537         WorldEntity::tick(dt);
     536        SUPER(SpaceShip, tick, dt);
    538537
    539538        this->roll(this->mouseXRotation_ * dt);
  • code/trunk/src/orxonox/objects/SpaceShipAI.cc

    r1608 r1747  
    4444namespace orxonox
    4545{
    46     SetConsoleCommand(SpaceShipAI, createEnemy, true).setDefaultValue(0, 1);
    47     SetConsoleCommand(SpaceShipAI, killEnemies, true).setDefaultValue(0, 0);
     46    SetConsoleCommand(SpaceShipAI, createEnemy, true).defaultValue(0, 1);
     47    SetConsoleCommand(SpaceShipAI, killEnemies, true).defaultValue(0, 0);
    4848
    4949    CreateFactory(SpaceShipAI);
     
    7272    SpaceShipAI::~SpaceShipAI()
    7373    {
    74         for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; ++it)
     74        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; ++it)
    7575            it->shipDied(this);
    7676    }
     
    7878    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7979    {
    80         SpaceShip::XMLPort(xmlelement, mode);
     80        SUPER(SpaceShipAI, XMLPort, xmlelement, mode);
    8181
    8282        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
     
    111111    {
    112112        int i = 0;
    113         for (Iterator<SpaceShipAI> it = ObjectList<SpaceShipAI>::begin(); it; )
     113        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; )
    114114        {
    115115            (it++)->kill();
     
    229229            this->doFire();
    230230
    231         SpaceShip::tick(dt);
     231        SUPER(SpaceShipAI, tick, dt);
    232232    }
    233233
     
    263263        this->forgetTarget();
    264264
    265         for (Iterator<SpaceShip> it = ObjectList<SpaceShip>::begin(); it; ++it)
     265        for (ObjectList<SpaceShip>::iterator it = ObjectList<SpaceShip>::begin(); it; ++it)
    266266        {
    267267            if (it->getTeamNr() != this->getTeamNr())
  • code/trunk/src/orxonox/objects/SpaceShipAI.h

    r1552 r1747  
    4747
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     49            virtual void tick(float dt);
    4950            static void createEnemy(int num);
    5051            static void killEnemies(int num);
     
    5455
    5556        private:
    56             virtual void tick(float dt);
    5757            virtual ColourValue getProjectileColour() const;
    5858
  • code/trunk/src/orxonox/objects/Tickable.h

    r1535 r1747  
    4545
    4646#include "core/OrxonoxClass.h"
     47#include "core/Super.h"
    4748
    4849namespace orxonox
     
    6162            Tickable();
    6263    };
     64
     65    SUPER_FUNCTION(1, Tickable, tick, true);
    6366
    6467    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1625 r1747  
    9595    }
    9696
    97 
    9897    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
    9998    {
     
    111110    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    112111    {
    113         BaseObject::XMLPort(xmlelement, mode);
     112        SUPER(WorldEntity, XMLPort, xmlelement, mode);
    114113
    115         XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);
    116         XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, mode);
     114        XMLPortParamExternTemplate(WorldEntity, Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, Ogre::Node, const Vector3&);
     115        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode);
    117116        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
    118         XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, mode);
    119         XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);
     117        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
     118        XMLPortParamTemplate(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, mode, WorldEntity, const Vector3&);
    120119        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
    121120
     
    150149      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
    151150      // register scale of node
    152       registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
    153       registerVar( (void*) &(this->getScale().y), sizeof(this->getScale().y), network::DATA, 0x3);
    154       registerVar( (void*) &(this->getScale().z), sizeof(this->getScale().z), network::DATA, 0x3);
     151      registerVar( (void*) &(this->getScale3D().x), sizeof(this->getScale3D().x), network::DATA, 0x3);
     152      registerVar( (void*) &(this->getScale3D().y), sizeof(this->getScale3D().y), network::DATA, 0x3);
     153      registerVar( (void*) &(this->getScale3D().z), sizeof(this->getScale3D().z), network::DATA, 0x3);
    155154      //register staticity
    156155      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r1625 r1747  
    6565            inline void setPosition(const Vector3& pos)
    6666                { this->node_->setPosition(pos); }
    67             inline void setPositionLoader1(const Vector3& pos)
    68                 { this->node_->setPosition(pos); }
    69             inline void setPositionLoader2(Real x, Real y, Real z)
    70                 { this->node_->setPosition(x, y, z); }
    7167            inline void setPosition(Real x, Real y, Real z)
    7268                { this->node_->setPosition(x, y, z); }
     
    108104            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    109105              { this->node_->rotate(axis, angle, relativeTo); }
    110             inline void setDirectionLoader(Real x, Real y, Real z)
     106            inline void setDirectionSimple(Real x, Real y, Real z)
    111107              { this->setDirection(x, y, z); }
    112108            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     
    117113              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    118114
    119             inline void setScale(const Vector3& scale)
     115            inline void setScale3D(const Vector3 &scale)
    120116              { this->node_->setScale(scale); }
    121             inline void setScale(Real x, Real y, Real z)
     117            inline void setScale3D(Real x, Real y, Real z)
    122118              { this->node_->setScale(x, y, z); }
    123             inline void setScale(Real scale)
     119            inline const Vector3& getScale3D(void) const
     120              { return this->node_->getScale(); }
     121            inline void setScale(float scale)
    124122              { this->node_->setScale(scale, scale, scale); }
    125             inline void setTotalScale(Real scale)
    126               { this->node_->setScale(scale, scale, scale); }
    127             inline const Vector3& getScale(void) const
    128               { return this->node_->getScale(); }
    129             inline void scale(const Vector3& scale)
     123            inline float getScale() const
     124              { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
     125            inline void scale3D(const Vector3 &scale)
    130126              { this->node_->scale(scale); }
    131             inline void scale(Real x, Real y, Real z)
     127            inline void scale3D(Real x, Real y, Real z)
    132128              { this->node_->scale(x, y, z); }
    133129            inline void scale(Real scale)
     
    159155                { return this->acceleration_; }
    160156
    161             inline void setRotationAxisLoader(const Vector3& axis)
    162                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
    163157            inline void setRotationAxis(const Vector3& axis)
    164                 { this->rotationAxis_ = axis; rotationAxis_.normalise(); }
     158                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
    165159            inline void setRotationAxis(Real x, Real y, Real z)
    166160                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r1633 r1747  
    5151    std::map<std::string, OrxonoxOverlay*> OrxonoxOverlay::overlays_s;
    5252
    53     SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).setAccessLevel(AccessLevel::User);
    54     SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).setAccessLevel(AccessLevel::User);
    55     SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).setAccessLevel(AccessLevel::User);
     53    SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User);
     54    SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User);
     55    SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User);
    5656
    5757    OrxonoxOverlay::OrxonoxOverlay()
     
    8484    @brief
    8585        Loads the OrxonoxOverlay.
    86        
     86
    8787        This has to be called before usage, otherwise strange behaviour is
    8888        guaranteed! (there should be no segfaults however).
     
    9292    void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    9393    {
    94         BaseObject::XMLPort(xmlElement, mode);
     94        SUPER(OrxonoxOverlay, XMLPort, xmlElement, mode);
    9595
    9696        if (mode == XMLPort::LoadObject)
     
    267267        if (angle > Ogre::Math::PI * 0.5)
    268268            angle = Ogre::Math::PI - angle;
    269        
     269
    270270        // do some mathematical fiddling for a bounding box
    271271        Vector2 actualSize = size_ * sizeCorrection_;
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r1633 r1747  
    150150        static void rotateOverlay(const std::string& name, const Degree& angle);
    151151
     152        virtual void changedVisibility();
     153
    152154    protected:
    153         virtual void changedVisibility();
    154155        virtual void angleChanged();
    155156        virtual void sizeCorrectionChanged();
  • code/trunk/src/orxonox/overlays/OverlayGroup.cc

    r1633 r1747  
    3535#include "OverlayGroup.h"
    3636
    37 #include "core/Debug.h"
     37#include "util/Debug.h"
    3838#include "core/ConsoleCommand.h"
    3939#include "core/CoreIncludes.h"
     40#include "core/Iterator.h"
    4041#include "core/XMLPort.h"
    4142#include "OrxonoxOverlay.h"
     
    4546    CreateFactory(OverlayGroup);
    4647
    47     SetConsoleCommand(OverlayGroup, toggleVisibility, false).setAccessLevel(AccessLevel::User);
    48     SetConsoleCommand(OverlayGroup, scaleGroup, false).setAccessLevel(AccessLevel::User);
    49     SetConsoleCommand(OverlayGroup, scrollGroup, false).setAccessLevel(AccessLevel::User);
     48    SetConsoleCommand(OverlayGroup, toggleVisibility, false).accessLevel(AccessLevel::User);
     49    SetConsoleCommand(OverlayGroup, scaleGroup, false).accessLevel(AccessLevel::User);
     50    SetConsoleCommand(OverlayGroup, scrollGroup, false).accessLevel(AccessLevel::User);
    5051
    5152    OverlayGroup::OverlayGroup()
     
    6263    void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    6364    {
    64         BaseObject::XMLPort(xmlElement, mode);
     65        SUPER(OverlayGroup, XMLPort, xmlElement, mode);
    6566
    6667        XMLPortParam(OverlayGroup, "scale",  setScale,  getScale,  xmlElement, mode).defaultValues(Vector2(1.0, 1.0));
     
    135136    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
    136137    {
    137         for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
     138        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    138139        {
    139140            if ((*it)->getName() == name)
     
    151152    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
    152153    {
    153         for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
     154        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    154155        {
    155156            if ((*it)->getName() == name)
     
    167168    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
    168169    {
    169         for (Iterator<OverlayGroup> it = ObjectList<OverlayGroup>::begin(); it; ++it)
     170        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    170171        {
    171172            if ((*it)->getName() == name)
  • code/trunk/src/orxonox/overlays/OverlayGroup.h

    r1633 r1747  
    5858        ~OverlayGroup() { }
    5959
    60         void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     60        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    6161
    6262        static void toggleVisibility(const std::string& name);
    6363        static void scaleGroup(const std::string& name, float scale);
    6464        static void scrollGroup(const std::string& name, const Vector2& scroll);
     65
     66        void changedVisibility();
    6567
    6668    private:
     
    8082        OrxonoxOverlay* getElement(unsigned int index);
    8183
    82         void changedVisibility();
    83 
    8484        std::map<std::string, OrxonoxOverlay*> hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
    8585        Vector2 scale_;                                         //!< Current scale (independant of the elements).
  • code/trunk/src/orxonox/overlays/OverlayText.cc

    r1632 r1747  
    5757    void OverlayText::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    5858    {
    59         OrxonoxOverlay::XMLPort(xmlElement, mode);
     59        SUPER(OverlayText, XMLPort, xmlElement, mode);
    6060
    6161        if (mode == XMLPort::LoadObject)
  • code/trunk/src/orxonox/overlays/console/InGameConsole.cc

    r1633 r1747  
    4141#include "util/Math.h"
    4242#include "util/Convert.h"
    43 #include "core/Debug.h"
     43#include "util/Debug.h"
    4444#include "core/CoreIncludes.h"
    4545#include "core/ConfigValueIncludes.h"
  • code/trunk/src/orxonox/overlays/console/InGameConsole.h

    r1625 r1747  
    5050            void setConfigValues();
    5151
    52             void tick(float dt);
     52            virtual void tick(float dt);
    5353
    5454            static InGameConsole& getInstance();
  • code/trunk/src/orxonox/overlays/debug/DebugFPSText.h

    r1625 r1747  
    4343        ~DebugFPSText();
    4444
    45     private:
    46         void tick(float dt);
    47 
    48     private:
     45        virtual void tick(float dt);
    4946    };
    5047}
  • code/trunk/src/orxonox/overlays/debug/DebugRTRText.h

    r1625 r1747  
    4343        ~DebugRTRText();
    4444
    45     private:
    46         void tick(float dt);
     45        virtual void tick(float dt);
    4746    };
    4847}
  • code/trunk/src/orxonox/overlays/hud/HUDBar.cc

    r1628 r1747  
    5353    void BarColour::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    5454    {
    55         BaseObject::XMLPort(xmlElement, mode);
     55        SUPER(BarColour, XMLPort, xmlElement, mode);
    5656
    5757        XMLPortParam(BarColour, "colour", setColour, getColour, xmlElement, mode)
     
    7878    void HUDBar::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    7979    {
    80         OrxonoxOverlay::XMLPort(xmlElement, mode);
     80        SUPER(HUDBar, XMLPort, xmlElement, mode);
    8181
    8282        if (mode == XMLPort::LoadObject)
  • code/trunk/src/orxonox/overlays/hud/HUDBar.h

    r1627 r1747  
    4747        ~BarColour() { }
    4848
    49         void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     49        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    5050
    5151        void setColour(const ColourValue& colour) { this->colour_ = colour; }
  • code/trunk/src/orxonox/overlays/hud/HUDNavigation.cc

    r1628 r1747  
    6969    void HUDNavigation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    7070    {
    71         OrxonoxOverlay::XMLPort(xmlElement, mode);
     71        SUPER(HUDNavigation, XMLPort, xmlElement, mode);
    7272
    7373        if (mode == XMLPort::LoadObject)
     
    8787                .createOverlayElement("Panel", "HUDNavigation_aimMarker_" + getUniqueNumberStr()));
    8888            aimMarker_->setMaterialName("Orxonox/NavCrosshair");
    89            
     89
    9090            background_->addChild(navMarker_);
    9191            background_->addChild(aimMarker_);
  • code/trunk/src/orxonox/overlays/hud/HUDNavigation.h

    r1627 r1747  
    4444        ~HUDNavigation();
    4545
    46         void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     46        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     47        virtual void tick(float dt);
    4748
    4849    private:
     
    5051        void angleChanged() { }
    5152        void positionChanged() { }
    52 
    53         void tick(float dt);
    5453
    5554        // XMLPort accessors
  • code/trunk/src/orxonox/overlays/hud/HUDRadar.cc

    r1628 r1747  
    6666    void HUDRadar::XMLPort(Element& xmlElement, XMLPort::Mode mode)
    6767    {
    68         OrxonoxOverlay::XMLPort(xmlElement, mode);
     68        SUPER(HUDRadar, XMLPort, xmlElement, mode);
    6969
    7070        if (mode == XMLPort::LoadObject)
  • code/trunk/src/orxonox/overlays/hud/HUDRadar.h

    r1625 r1747  
    4848        ~HUDRadar();
    4949
    50         void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     50        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    5151
    5252    private:
  • code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h

    r1625 r1747  
    4444        ~HUDSpeedBar();
    4545
    46     private:
    47         void tick(float dt);
     46        virtual void tick(float dt);
    4847    };
    4948}
  • code/trunk/src/orxonox/tools/WindowEventListener.cc

    r1625 r1747  
    3838    WindowEventListener::WindowEventListener()
    3939    {
    40         RegisterObject(WindowEventListener);
     40        RegisterRootObject(WindowEventListener);
    4141    }
    4242}
  • code/trunk/src/util/CMakeLists.txt

    r1505 r1747  
    22  ArgReader.cc
    33  Clipboard.cc
     4  Error.cc
    45  ExprParser.cc
    56  Math.cc
    6   MultiTypePrimitive.cc
    7   MultiTypeString.cc
    8   MultiTypeMath.cc
     7  MultiType.cc
     8  OutputBuffer.cc
     9  OutputHandler.cc
    910  String.cc
    1011  SubString.cc
  • code/trunk/src/util/Convert.h

    r1625 r1747  
    4141
    4242#include "Math.h"
     43#include "Debug.h"
    4344#include "SubString.h"
    44 #include "MultiTypeMath.h"
    4545#include "String.h"
    4646
     
    7575    enum { specialized = false };
    7676    static bool convert(ToType* output, const FromType& input)
    77     { return false; }
     77    {
     78        COUT(2) << "Warning: Couldn't convert a value: From \"" << typeid(FromType).name() << "\" to \"" << typeid(ToType).name() << "\"" << std::endl;
     79        return false;
     80    }
    7881};
    7982
     
    9598
    9699// Defines the levels of all types: Default is __high__ so you don't have to define every high-level type
    97 template <class T> struct ConverterLevel           { enum { level = __high__ }; };
    98 template <> struct ConverterLevel<std::string>     { enum { level = __mid__ }; };
    99 template <> struct ConverterLevel<orxonox::Radian> { enum { level = __mid__ }; };
    100 template <> struct ConverterLevel<orxonox::Degree> { enum { level = __mid__ }; };
    101 template <> struct ConverterLevel<int>             { enum { level = __low__ }; };
    102 template <> struct ConverterLevel<unsigned int>    { enum { level = __low__ }; };
    103 template <> struct ConverterLevel<char>            { enum { level = __low__ }; };
    104 template <> struct ConverterLevel<unsigned char>   { enum { level = __low__ }; };
    105 template <> struct ConverterLevel<short>           { enum { level = __low__ }; };
    106 template <> struct ConverterLevel<unsigned short>  { enum { level = __low__ }; };
    107 template <> struct ConverterLevel<long>            { enum { level = __low__ }; };
    108 template <> struct ConverterLevel<unsigned long>   { enum { level = __low__ }; };
    109 template <> struct ConverterLevel<float>           { enum { level = __low__ }; };
    110 template <> struct ConverterLevel<double>          { enum { level = __low__ }; };
    111 template <> struct ConverterLevel<long double>     { enum { level = __low__ }; };
    112 template <> struct ConverterLevel<bool>            { enum { level = __low__ }; };
     100template <class T> struct ConverterLevel              { enum { level = __high__ }; };
     101template <> struct ConverterLevel<std::string>        { enum { level = __mid__ }; };
     102template <> struct ConverterLevel<orxonox::Radian>    { enum { level = __mid__ }; };
     103template <> struct ConverterLevel<orxonox::Degree>    { enum { level = __mid__ }; };
     104template <> struct ConverterLevel<int>                { enum { level = __low__ }; };
     105template <> struct ConverterLevel<unsigned int>       { enum { level = __low__ }; };
     106template <> struct ConverterLevel<char>               { enum { level = __low__ }; };
     107template <> struct ConverterLevel<unsigned char>      { enum { level = __low__ }; };
     108template <> struct ConverterLevel<short>              { enum { level = __low__ }; };
     109template <> struct ConverterLevel<unsigned short>     { enum { level = __low__ }; };
     110template <> struct ConverterLevel<long>               { enum { level = __low__ }; };
     111template <> struct ConverterLevel<unsigned long>      { enum { level = __low__ }; };
     112template <> struct ConverterLevel<long long>          { enum { level = __low__ }; };
     113template <> struct ConverterLevel<unsigned long long> { enum { level = __low__ }; };
     114template <> struct ConverterLevel<float>              { enum { level = __low__ }; };
     115template <> struct ConverterLevel<double>             { enum { level = __low__ }; };
     116template <> struct ConverterLevel<long double>        { enum { level = __low__ }; };
     117template <> struct ConverterLevel<bool>               { enum { level = __low__ }; };
    113118
    114119
     
    140145    static bool convert(ToType* output, const FromType& input)
    141146    {
     147        COUT(2) << "Warning: Couldn't convert a value: From \"" << typeid(FromType).name() << "\" to \"" << typeid(ToType).name() << "\"" << std::endl;
    142148        return false;
    143149    }
     
    330336
    331337
    332 ////////////////
    333 // MULTITYPES //
    334 ////////////////
    335 
    336 // convert from MultiTypePrimitive
    337 template <class ToType>
    338 struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>
    339 {
    340     enum { specialized = true };
    341     static bool convert(ToType* output, const MultiTypePrimitive& input)
    342     {
    343         if (input.getType() == MT_void)
    344             return ConvertValue(output, input.getVoid());
    345         else if (input.getType() == MT_int)
    346             return ConvertValue(output, input.getInt());
    347         else if (input.getType() == MT_uint)
    348             return ConvertValue(output, input.getUnsignedInt());
    349         else if (input.getType() == MT_char)
    350             return ConvertValue(output, input.getChar());
    351         else if (input.getType() == MT_uchar)
    352             return ConvertValue(output, input.getUnsignedChar());
    353         else if (input.getType() == MT_short)
    354             return ConvertValue(output, input.getShort());
    355         else if (input.getType() == MT_ushort)
    356             return ConvertValue(output, input.getUnsignedShort());
    357         else if (input.getType() == MT_long)
    358             return ConvertValue(output, input.getLong());
    359         else if (input.getType() == MT_ulong)
    360             return ConvertValue(output, input.getUnsignedLong());
    361         else if (input.getType() == MT_float)
    362             return ConvertValue(output, input.getFloat());
    363         else if (input.getType() == MT_double)
    364             return ConvertValue(output, input.getDouble());
    365         else if (input.getType() == MT_longdouble)
    366             return ConvertValue(output, input.getLongDouble());
    367         else if (input.getType() == MT_bool)
    368             return ConvertValue(output, input.getBool());
    369         else
    370             return false;
    371     }
    372 };
    373 
    374 // convert from MultiTypeString
    375 template <class ToType>
    376 struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>
    377 {
    378     enum { specialized = true };
    379     static bool convert(ToType* output, const MultiTypeString& input)
    380     {
    381         if (input.getType() == MT_constchar)
    382             return ConvertValue(output, input.getConstChar());
    383         else if (input.getType() == MT_string)
    384             return ConvertValue(output, input.getString());
    385         else
    386             return ConvertValue(output, (MultiTypePrimitive)input);
    387     }
    388 };
    389 
    390 // convert from MultiTypeMath
    391 template <class ToType>
    392 struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>
    393 {
    394     enum { specialized = true };
    395     static bool convert(ToType* output, const MultiTypeMath& input)
    396     {
    397         if (input.getType() == MT_vector2)
    398             return ConvertValue(output, input.getVector2());
    399         else if (input.getType() == MT_vector3)
    400             return ConvertValue(output, input.getVector3());
    401         else if (input.getType() == MT_vector4)
    402             return ConvertValue(output, input.getVector4());
    403         else if (input.getType() == MT_quaternion)
    404             return ConvertValue(output, input.getQuaternion());
    405         else if (input.getType() == MT_colourvalue)
    406             return ConvertValue(output, input.getColourValue());
    407         else if (input.getType() == MT_radian)
    408             return ConvertValue(output, input.getRadian());
    409         else if (input.getType() == MT_degree)
    410             return ConvertValue(output, input.getDegree());
    411         else
    412             return ConvertValue(output, (MultiTypeString)input);
     338//////////
     339// MATH //
     340//////////
     341// convert everything to Degree
     342template <class FromType>
     343struct ConverterSpecialized<FromType, Ogre::Degree, _ToType_>
     344{
     345    enum { specialized = true };
     346    static bool convert(Ogre::Degree* output, const FromType& input)
     347    {
     348        float angle = 0;
     349        bool success = ConvertValue<FromType, float>(&angle, input);
     350        (*output) = angle;
     351        return success;
     352    }
     353};
     354
     355// convert everything to Radian
     356template <class FromType>
     357struct ConverterSpecialized<FromType, Ogre::Radian, _ToType_>
     358{
     359    enum { specialized = true };
     360    static bool convert(Ogre::Radian* output, const FromType& input)
     361    {
     362        float angle = 0;
     363        bool success = ConvertValue<FromType, float>(&angle, input);
     364        (*output) = angle;
     365        return success;
    413366    }
    414367};
  • code/trunk/src/util/MultiType.h

    r1505 r1747  
    2525 *      ...
    2626 *
    27  *   Inspiration: MultiType by Benjamin Grauer
    2827 */
    2928
     
    3332#include "UtilPrereqs.h"
    3433
    35 enum _UtilExport MultiType
     34#include <boost/static_assert.hpp>
     35
     36#include "Math.h"
     37
     38enum MT_Type
    3639{
    3740    MT_null,
    38     MT_void,
    39     MT_int,
    40     MT_uint,
    4141    MT_char,
    4242    MT_uchar,
    4343    MT_short,
    4444    MT_ushort,
     45    MT_int,
     46    MT_uint,
    4547    MT_long,
    4648    MT_ulong,
     49    MT_longlong,
     50    MT_ulonglong,
    4751    MT_float,
    4852    MT_double,
    4953    MT_longdouble,
    5054    MT_bool,
    51     MT_constchar,
     55    MT_void,
    5256    MT_string,
    53     MT_xmlelement,
    5457    MT_vector2,
    5558    MT_vector3,
     
    5760    MT_colourvalue,
    5861    MT_quaternion,
    59     MT_degree,
    60     MT_radian
     62    MT_radian,
     63    MT_degree
    6164};
    6265
    63 union _UtilExport MultiTypeValue
     66class _UtilExport MultiType
    6467{
    65     void*           void_;
    66     int             int_;
    67     unsigned int    uint_;
    68     char            char_;
    69     unsigned char   uchar_;
    70     short           short_;
    71     unsigned short  ushort_;
    72     long            long_;
    73     unsigned long   ulong_;
    74     float           float_;
    75     double          double_;
    76     long double     longdouble_;
    77     bool            bool_;
     68    _UtilExport friend std::ostream& operator<<(std::ostream& outstream, const MultiType& mt);
     69    template <typename T> friend struct MT_Value;
     70
     71    struct _UtilExport MT_ValueBase
     72    {
     73        MT_ValueBase(MT_Type type) : type_(type) {}
     74        virtual ~MT_ValueBase() {}
     75
     76        virtual MT_ValueBase* clone() const = 0;
     77
     78        virtual void reset() = 0;
     79        virtual void assimilate(const MultiType& other) = 0;
     80        const MT_Type& getType() const { return this->type_; }
     81
     82        virtual void setValue(const char& value)                 = 0;
     83        virtual void setValue(const unsigned char& value)        = 0;
     84        virtual void setValue(const short& value)                = 0;
     85        virtual void setValue(const unsigned short& value)       = 0;
     86        virtual void setValue(const int& value)                  = 0;
     87        virtual void setValue(const unsigned int& value)         = 0;
     88        virtual void setValue(const long& value)                 = 0;
     89        virtual void setValue(const unsigned long& value)        = 0;
     90        virtual void setValue(const long long& value)            = 0;
     91        virtual void setValue(const unsigned long long& value)   = 0;
     92        virtual void setValue(const float& value)                = 0;
     93        virtual void setValue(const double& value)               = 0;
     94        virtual void setValue(const long double& value)          = 0;
     95        virtual void setValue(const bool& value)                 = 0;
     96        virtual void setValue(      void* const& value)          = 0;
     97        virtual void setValue(const std::string& value)          = 0;
     98        virtual void setValue(const orxonox::Vector2& value)     = 0;
     99        virtual void setValue(const orxonox::Vector3& value)     = 0;
     100        virtual void setValue(const orxonox::Vector4& value)     = 0;
     101        virtual void setValue(const orxonox::ColourValue& value) = 0;
     102        virtual void setValue(const orxonox::Quaternion& value)  = 0;
     103        virtual void setValue(const orxonox::Radian& value)      = 0;
     104        virtual void setValue(const orxonox::Degree& value)      = 0;
     105
     106        virtual operator char()                 const = 0;
     107        virtual operator unsigned char()        const = 0;
     108        virtual operator short()                const = 0;
     109        virtual operator unsigned short()       const = 0;
     110        virtual operator int()                  const = 0;
     111        virtual operator unsigned int()         const = 0;
     112        virtual operator long()                 const = 0;
     113        virtual operator unsigned long()        const = 0;
     114        virtual operator long long()            const = 0;
     115        virtual operator unsigned long long()   const = 0;
     116        virtual operator float()                const = 0;
     117        virtual operator double()               const = 0;
     118        virtual operator long double()          const = 0;
     119        virtual operator bool()                 const = 0;
     120        virtual operator void*()                const = 0;
     121        virtual operator std::string()          const = 0;
     122        virtual operator orxonox::Vector2()     const = 0;
     123        virtual operator orxonox::Vector3()     const = 0;
     124        virtual operator orxonox::Vector4()     const = 0;
     125        virtual operator orxonox::ColourValue() const = 0;
     126        virtual operator orxonox::Quaternion()  const = 0;
     127        virtual operator orxonox::Radian()      const = 0;
     128        virtual operator orxonox::Degree()      const = 0;
     129
     130        virtual void toString(std::ostream& outstream) const = 0;
     131
     132        MT_Type type_;
     133    };
     134
     135    public:
     136        inline MultiType()                                  : value_(0) {}
     137        inline MultiType(const char& value)                 : value_(0) { this->assignValue(value); }
     138        inline MultiType(const unsigned char& value)        : value_(0) { this->assignValue(value); }
     139        inline MultiType(const short& value)                : value_(0) { this->assignValue(value); }
     140        inline MultiType(const unsigned short& value)       : value_(0) { this->assignValue(value); }
     141        inline MultiType(const int& value)                  : value_(0) { this->assignValue(value); }
     142        inline MultiType(const unsigned int& value)         : value_(0) { this->assignValue(value); }
     143        inline MultiType(const long& value)                 : value_(0) { this->assignValue(value); }
     144        inline MultiType(const unsigned long& value)        : value_(0) { this->assignValue(value); }
     145        inline MultiType(const long long& value)            : value_(0) { this->assignValue(value); }
     146        inline MultiType(const unsigned long long& value)   : value_(0) { this->assignValue(value); }
     147        inline MultiType(const float& value)                : value_(0) { this->assignValue(value); }
     148        inline MultiType(const double& value)               : value_(0) { this->assignValue(value); }
     149        inline MultiType(const long double& value)          : value_(0) { this->assignValue(value); }
     150        inline MultiType(const bool& value)                 : value_(0) { this->assignValue(value); }
     151        inline MultiType(      void* const& value)          : value_(0) { this->assignValue(value); }
     152        inline MultiType(const std::string& value)          : value_(0) { this->assignValue(value); }
     153        inline MultiType(const orxonox::Vector2& value)     : value_(0) { this->assignValue(value); }
     154        inline MultiType(const orxonox::Vector3& value)     : value_(0) { this->assignValue(value); }
     155        inline MultiType(const orxonox::Vector4& value)     : value_(0) { this->assignValue(value); }
     156        inline MultiType(const orxonox::ColourValue& value) : value_(0) { this->assignValue(value); }
     157        inline MultiType(const orxonox::Quaternion& value)  : value_(0) { this->assignValue(value); }
     158        inline MultiType(const orxonox::Radian& value)      : value_(0) { this->assignValue(value); }
     159        inline MultiType(const orxonox::Degree& value)      : value_(0) { this->assignValue(value); }
     160        inline MultiType(const char* value)                 : value_(0) { this->setValue(std::string(value)); }
     161        inline MultiType(const MultiType& other)            : value_(0) { this->setValue(other); }
     162        inline MultiType(MT_Type type)                      : value_(0) { this->setType(type); }
     163
     164        inline ~MultiType() { if (this->value_) { delete this->value_; } }
     165
     166        template <typename V> inline MultiType& operator=(const V& value)         { this->setValue(value); return (*this); }
     167        inline                       MultiType& operator=(const MultiType& other) { this->setValue(other); return (*this); }
     168        inline                       MultiType& operator=(MT_Type type)           { this->setType(type);   return (*this); }
     169
     170        inline void                                   setValue(const char& value);
     171        inline void                                   setValue(const unsigned char& value);
     172        inline void                                   setValue(const short& value);
     173        inline void                                   setValue(const unsigned short& value);
     174        inline void                                   setValue(const int& value);
     175        inline void                                   setValue(const unsigned int& value);
     176        inline void                                   setValue(const long& value);
     177        inline void                                   setValue(const unsigned long& value);
     178        inline void                                   setValue(const long long& value);
     179        inline void                                   setValue(const unsigned long long& value);
     180        inline void                                   setValue(const float& value);
     181        inline void                                   setValue(const double& value);
     182        inline void                                   setValue(const long double& value);
     183        inline void                                   setValue(const bool& value);
     184        inline void                                   setValue(      void* const& value);
     185        inline void                                   setValue(const std::string& value);
     186        inline void                                   setValue(const orxonox::Vector2& value);
     187        inline void                                   setValue(const orxonox::Vector3& value);
     188        inline void                                   setValue(const orxonox::Vector4& value);
     189        inline void                                   setValue(const orxonox::ColourValue& value);
     190        inline void                                   setValue(const orxonox::Quaternion& value);
     191        inline void                                   setValue(const orxonox::Radian& value);
     192        inline void                                   setValue(const orxonox::Degree& value);
     193        template <typename V> inline void             setValue(V* value)               { if (this->value_) { this->value_->setValue((void*)value); } else { this->assignValue((void*)value); } }
     194        void                                          setValue(const MultiType& other) { if (this->value_) { this->value_->assimilate(other); } else { if (other.value_) { this->value_ = other.value_->clone(); } } }
     195        template <typename T, typename V> inline void setValue(const V& value)         { this->setType<T>(); this->setValue(value); }
     196        inline void                                   setValue(const char* value);
     197
     198        inline void                       copy(const MultiType& other)    { if (this == &other) { return; } if (this->value_) { delete this->value_; } this->value_ = (other.value_) ? other.value_->clone() : 0; }
     199
     200        template <typename T> inline void convert()                       { this->setValue<T>((T)(*this));  }
     201        inline void                       convert(const MultiType& other) { this->convert(other.getType()); }
     202        void                              convert(MT_Type type);
     203
     204        inline void                       reset()                         { if (this->value_) { delete this->value_; this->value_ = 0; } }
     205
     206        template <typename T> inline void setType()                       { this->assignValue(T());             }
     207        inline void                       setType(const MultiType& other) { this->setType(other.getType());     }
     208        inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); }
     209
     210        inline MT_Type                    getType()                 const { return (this->value_) ? this->value_->type_ : MT_null; }
     211        inline bool                       isType(MT_Type type)      const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_null); }
     212        template <typename T> inline bool isType()                  const { return false; }
     213        std::string                       getTypename()             const;
     214
     215        operator char()                  const;
     216        operator unsigned char()         const;
     217        operator short()                 const;
     218        operator unsigned short()        const;
     219        operator int()                   const;
     220        operator unsigned int()          const;
     221        operator long()                  const;
     222        operator unsigned long()         const;
     223        operator long long()             const;
     224        operator unsigned long long()    const;
     225        operator float()                 const;
     226        operator double()                const;
     227        operator long double()           const;
     228        operator bool()                  const;
     229        operator void*()                 const;
     230        operator std::string()           const;
     231        operator orxonox::Vector2()      const;
     232        operator orxonox::Vector3()      const;
     233        operator orxonox::Vector4()      const;
     234        operator orxonox::ColourValue()  const;
     235        operator orxonox::Quaternion()   const;
     236        operator orxonox::Radian()       const;
     237        operator orxonox::Degree()       const;
     238        template <class T> operator T*() const { return ((T*)this->operator void*()); }
     239
     240        inline void getValue(char*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
     241        inline void getValue(unsigned char*        value) const { if (this->value_) { (*value) = (*this->value_); } }
     242        inline void getValue(short*                value) const { if (this->value_) { (*value) = (*this->value_); } }
     243        inline void getValue(unsigned short*       value) const { if (this->value_) { (*value) = (*this->value_); } }
     244        inline void getValue(int*                  value) const { if (this->value_) { (*value) = (*this->value_); } }
     245        inline void getValue(unsigned int*         value) const { if (this->value_) { (*value) = (*this->value_); } }
     246        inline void getValue(long*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
     247        inline void getValue(unsigned long*        value) const { if (this->value_) { (*value) = (*this->value_); } }
     248        inline void getValue(long long*            value) const { if (this->value_) { (*value) = (*this->value_); } }
     249        inline void getValue(unsigned long long*   value) const { if (this->value_) { (*value) = (*this->value_); } }
     250        inline void getValue(float*                value) const { if (this->value_) { (*value) = (*this->value_); } }
     251        inline void getValue(double*               value) const { if (this->value_) { (*value) = (*this->value_); } }
     252        inline void getValue(long double*          value) const { if (this->value_) { (*value) = (*this->value_); } }
     253        inline void getValue(bool*                 value) const { if (this->value_) { (*value) = (*this->value_); } }
     254        inline void getValue(void*                 value) const { if (this->value_) {   value  = (*this->value_); } }
     255        inline void getValue(std::string*          value) const { if (this->value_) { (*value) = this->value_->operator std::string();          } }
     256        inline void getValue(orxonox::Vector2*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector2();     } }
     257        inline void getValue(orxonox::Vector3*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector3();     } }
     258        inline void getValue(orxonox::Vector4*     value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Vector4();     } }
     259        inline void getValue(orxonox::ColourValue* value) const { if (this->value_) { (*value) = this->value_->operator orxonox::ColourValue(); } }
     260        inline void getValue(orxonox::Quaternion*  value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Quaternion();  } }
     261        inline void getValue(orxonox::Radian*      value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Radian();      } }
     262        inline void getValue(orxonox::Degree*      value) const { if (this->value_) { (*value) = this->value_->operator orxonox::Degree();      } }
     263
     264        inline char                     getChar()             const { return this->operator char();                 }
     265        inline unsigned char            getUnsignedChar()     const { return this->operator unsigned char();        }
     266        inline short                    getShort()            const { return this->operator short();                }
     267        inline unsigned short           getUnsignedShort()    const { return this->operator unsigned short();       }
     268        inline int                      getInt()              const { return this->operator int();                  }
     269        inline unsigned int             getUnsignedInt()      const { return this->operator unsigned int();         }
     270        inline long                     getLong()             const { return this->operator long();                 }
     271        inline unsigned long            getUnsignedLong()     const { return this->operator unsigned long();        }
     272        inline long long                getLongLong()         const { return this->operator long long();            }
     273        inline unsigned long long       getUnsignedLongLong() const { return this->operator unsigned long long();   }
     274        inline float                    getFloat()            const { return this->operator float();                }
     275        inline double                   getDouble()           const { return this->operator double();               }
     276        inline long double              getLongDouble()       const { return this->operator long double();          }
     277        inline bool                     getBool()             const { return this->operator bool();                 }
     278        inline void*                    getVoid()             const { return this->operator void*();                }
     279        inline std::string              getString()           const { return this->operator std::string();          }
     280        inline orxonox::Vector2         getVector2()          const { return this->operator orxonox::Vector2();     }
     281        inline orxonox::Vector3         getVector3()          const { return this->operator orxonox::Vector3();     }
     282        inline orxonox::Vector4         getVector4()          const { return this->operator orxonox::Vector4();     }
     283        inline orxonox::ColourValue     getColourValue()      const { return this->operator orxonox::ColourValue(); }
     284        inline orxonox::Quaternion      getQuaternion()       const { return this->operator orxonox::Quaternion();  }
     285        inline orxonox::Radian          getRadian()           const { return this->operator orxonox::Radian();      }
     286        inline orxonox::Degree          getDegree()           const { return this->operator orxonox::Degree();      }
     287        template <typename T> inline T* getPointer()          const { return ((T*)this->getVoid());                 }
     288
     289    private:
     290        inline void assignValue(const char& value)                 { if (this->value_ && this->value_->type_ == MT_char)        { this->value_->setValue(value); } else { this->changeValueContainer<char>(value);                 } }
     291        inline void assignValue(const unsigned char& value)        { if (this->value_ && this->value_->type_ == MT_uchar)       { this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value);        } }
     292        inline void assignValue(const short& value)                { if (this->value_ && this->value_->type_ == MT_short)       { this->value_->setValue(value); } else { this->changeValueContainer<short>(value);                } }
     293        inline void assignValue(const unsigned short& value)       { if (this->value_ && this->value_->type_ == MT_ushort)      { this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value);       } }
     294        inline void assignValue(const int& value)                  { if (this->value_ && this->value_->type_ == MT_int)         { this->value_->setValue(value); } else { this->changeValueContainer<int>(value);                  } }
     295        inline void assignValue(const unsigned int& value)         { if (this->value_ && this->value_->type_ == MT_uint)        { this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value);         } }
     296        inline void assignValue(const long& value)                 { if (this->value_ && this->value_->type_ == MT_long)        { this->value_->setValue(value); } else { this->changeValueContainer<long>(value);                 } }
     297        inline void assignValue(const unsigned long& value)        { if (this->value_ && this->value_->type_ == MT_ulong)       { this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value);        } }
     298        inline void assignValue(const long long& value)            { if (this->value_ && this->value_->type_ == MT_longlong)    { this->value_->setValue(value); } else { this->changeValueContainer<long long>(value);            } }
     299        inline void assignValue(const unsigned long long& value)   { if (this->value_ && this->value_->type_ == MT_ulonglong)   { this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value);   } }
     300        inline void assignValue(const float& value)                { if (this->value_ && this->value_->type_ == MT_float)       { this->value_->setValue(value); } else { this->changeValueContainer<float>(value);                } }
     301        inline void assignValue(const double& value)               { if (this->value_ && this->value_->type_ == MT_double)      { this->value_->setValue(value); } else { this->changeValueContainer<double>(value);               } }
     302        inline void assignValue(const long double& value)          { if (this->value_ && this->value_->type_ == MT_longdouble)  { this->value_->setValue(value); } else { this->changeValueContainer<long double>(value);          } }
     303        inline void assignValue(const bool& value)                 { if (this->value_ && this->value_->type_ == MT_bool)        { this->value_->setValue(value); } else { this->changeValueContainer<bool>(value);                 } }
     304        inline void assignValue(      void* const& value)          { if (this->value_ && this->value_->type_ == MT_void)        { this->value_->setValue(value); } else { this->changeValueContainer<void*>(value);                } }
     305        inline void assignValue(const std::string& value)          { if (this->value_ && this->value_->type_ == MT_string)      { this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value);          } }
     306        inline void assignValue(const orxonox::Vector2& value)     { if (this->value_ && this->value_->type_ == MT_vector2)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value);     } }
     307        inline void assignValue(const orxonox::Vector3& value)     { if (this->value_ && this->value_->type_ == MT_vector3)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value);     } }
     308        inline void assignValue(const orxonox::Vector4& value)     { if (this->value_ && this->value_->type_ == MT_vector4)     { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value);     } }
     309        inline void assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_colourvalue) { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); } }
     310        inline void assignValue(const orxonox::Quaternion& value)  { if (this->value_ && this->value_->type_ == MT_quaternion)  { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value);  } }
     311        inline void assignValue(const orxonox::Radian& value)      { if (this->value_ && this->value_->type_ == MT_radian)      { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value);      } }
     312        inline void assignValue(const orxonox::Degree& value)      { if (this->value_ && this->value_->type_ == MT_degree)      { this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value);      } }
     313
     314        template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
     315        template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); }
     316
     317        MT_ValueBase* value_;
    78318};
    79319
     320_UtilExport inline std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
     321
     322template <> inline bool MultiType::isType<char>()                 const { return (this->value_ && this->value_->type_ == MT_char);        }
     323template <> inline bool MultiType::isType<unsigned char>()        const { return (this->value_ && this->value_->type_ == MT_uchar);       }
     324template <> inline bool MultiType::isType<short>()                const { return (this->value_ && this->value_->type_ == MT_short);       }
     325template <> inline bool MultiType::isType<unsigned short>()       const { return (this->value_ && this->value_->type_ == MT_ushort);      }
     326template <> inline bool MultiType::isType<int>()                  const { return (this->value_ && this->value_->type_ == MT_int);         }
     327template <> inline bool MultiType::isType<unsigned int>()         const { return (this->value_ && this->value_->type_ == MT_uint);        }
     328template <> inline bool MultiType::isType<long>()                 const { return (this->value_ && this->value_->type_ == MT_long);        }
     329template <> inline bool MultiType::isType<unsigned long>()        const { return (this->value_ && this->value_->type_ == MT_ulong);       }
     330template <> inline bool MultiType::isType<long long>()            const { return (this->value_ && this->value_->type_ == MT_longlong);    }
     331template <> inline bool MultiType::isType<unsigned long long>()   const { return (this->value_ && this->value_->type_ == MT_ulonglong);   }
     332template <> inline bool MultiType::isType<float>()                const { return (this->value_ && this->value_->type_ == MT_float);       }
     333template <> inline bool MultiType::isType<double>()               const { return (this->value_ && this->value_->type_ == MT_double);      }
     334template <> inline bool MultiType::isType<long double>()          const { return (this->value_ && this->value_->type_ == MT_longdouble);  }
     335template <> inline bool MultiType::isType<bool>()                 const { return (this->value_ && this->value_->type_ == MT_bool);        }
     336template <> inline bool MultiType::isType<void*>()                const { return (this->value_ && this->value_->type_ == MT_void);        }
     337template <> inline bool MultiType::isType<std::string>()          const { return (this->value_ && this->value_->type_ == MT_string);      }
     338template <> inline bool MultiType::isType<orxonox::Vector2>()     const { return (this->value_ && this->value_->type_ == MT_vector2);     }
     339template <> inline bool MultiType::isType<orxonox::Vector3>()     const { return (this->value_ && this->value_->type_ == MT_vector3);     }
     340template <> inline bool MultiType::isType<orxonox::Vector4>()     const { return (this->value_ && this->value_->type_ == MT_vector4);     }
     341template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_colourvalue); }
     342template <> inline bool MultiType::isType<orxonox::Quaternion>()  const { return (this->value_ && this->value_->type_ == MT_quaternion);  }
     343template <> inline bool MultiType::isType<orxonox::Radian>()      const { return (this->value_ && this->value_->type_ == MT_radian);      }
     344template <> inline bool MultiType::isType<orxonox::Degree>()      const { return (this->value_ && this->value_->type_ == MT_degree);      }
     345
     346template <> inline void MultiType::convert<std::string>()          { this->setValue<std::string>         (this->operator std::string());          }
     347template <> inline void MultiType::convert<orxonox::Vector2>()     { this->setValue<orxonox::Vector2>    (this->operator orxonox::Vector2());     }
     348template <> inline void MultiType::convert<orxonox::Vector3>()     { this->setValue<orxonox::Vector3>    (this->operator orxonox::Vector3());     }
     349template <> inline void MultiType::convert<orxonox::Vector4>()     { this->setValue<orxonox::Vector4>    (this->operator orxonox::Vector4());     }
     350template <> inline void MultiType::convert<orxonox::ColourValue>() { this->setValue<orxonox::ColourValue>(this->operator orxonox::ColourValue()); }
     351template <> inline void MultiType::convert<orxonox::Quaternion>()  { this->setValue<orxonox::Quaternion> (this->operator orxonox::Quaternion());  }
     352template <> inline void MultiType::convert<orxonox::Radian>()      { this->setValue<orxonox::Radian>     (this->operator orxonox::Radian());      }
     353template <> inline void MultiType::convert<orxonox::Degree>()      { this->setValue<orxonox::Degree>     (this->operator orxonox::Degree());      }
     354
     355template <> inline void MultiType::convert<const std::string&>()          { this->convert<std::string>();          }
     356template <> inline void MultiType::convert<const orxonox::Vector2&>()     { this->convert<orxonox::Vector2>();     }
     357template <> inline void MultiType::convert<const orxonox::Vector3&>()     { this->convert<orxonox::Vector3>();     }
     358template <> inline void MultiType::convert<const orxonox::Vector4&>()     { this->convert<orxonox::Vector4>();     }
     359template <> inline void MultiType::convert<const orxonox::ColourValue&>() { this->convert<orxonox::ColourValue>(); }
     360template <> inline void MultiType::convert<const orxonox::Quaternion&>()  { this->convert<orxonox::Quaternion>();  }
     361template <> inline void MultiType::convert<const orxonox::Radian&>()      { this->convert<orxonox::Radian>();      }
     362template <> inline void MultiType::convert<const orxonox::Degree&>()      { this->convert<orxonox::Degree>();      }
     363
     364template <> void MultiType::createNewValueContainer(const char& value);
     365template <> void MultiType::createNewValueContainer(const unsigned char& value);
     366template <> void MultiType::createNewValueContainer(const short& value);
     367template <> void MultiType::createNewValueContainer(const unsigned short& value);
     368template <> void MultiType::createNewValueContainer(const int& value);
     369template <> void MultiType::createNewValueContainer(const unsigned int& value);
     370template <> void MultiType::createNewValueContainer(const long& value);
     371template <> void MultiType::createNewValueContainer(const unsigned long& value);
     372template <> void MultiType::createNewValueContainer(const long long& value);
     373template <> void MultiType::createNewValueContainer(const unsigned long long& value);
     374template <> void MultiType::createNewValueContainer(const float& value);
     375template <> void MultiType::createNewValueContainer(const double& value);
     376template <> void MultiType::createNewValueContainer(const bool& value);
     377template <> void MultiType::createNewValueContainer(const long double& value);
     378template <> void MultiType::createNewValueContainer(      void* const& value);
     379template <> void MultiType::createNewValueContainer(const std::string& value);
     380template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value);
     381template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value);
     382template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value);
     383template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value);
     384template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value);
     385template <> void MultiType::createNewValueContainer(const orxonox::Radian& value);
     386template <> void MultiType::createNewValueContainer(const orxonox::Degree& value);
     387
     388inline void MultiType::setValue(const char& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     389inline void MultiType::setValue(const unsigned char& value)         { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     390inline void MultiType::setValue(const short& value)                 { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     391inline void MultiType::setValue(const unsigned short& value)        { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     392inline void MultiType::setValue(const int& value)                   { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     393inline void MultiType::setValue(const unsigned int& value)          { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     394inline void MultiType::setValue(const long& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     395inline void MultiType::setValue(const unsigned long& value)         { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     396inline void MultiType::setValue(const long long& value)             { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     397inline void MultiType::setValue(const unsigned long long& value)    { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     398inline void MultiType::setValue(const float& value)                 { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     399inline void MultiType::setValue(const double& value)                { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     400inline void MultiType::setValue(const long double& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     401inline void MultiType::setValue(const bool& value)                  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     402inline void MultiType::setValue(      void* const& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     403inline void MultiType::setValue(const std::string& value)           { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     404inline void MultiType::setValue(const orxonox::Vector2& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     405inline void MultiType::setValue(const orxonox::Vector3& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     406inline void MultiType::setValue(const orxonox::Vector4& value)      { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     407inline void MultiType::setValue(const orxonox::ColourValue& value)  { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     408inline void MultiType::setValue(const orxonox::Quaternion& value)   { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     409inline void MultiType::setValue(const orxonox::Radian& value)       { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     410inline void MultiType::setValue(const orxonox::Degree& value)       { if (this->value_) { this->value_->setValue(value); } else { this->assignValue(value); } }
     411
     412inline void MultiType::setValue(const char* value)                  { if (this->value_) { this->value_->setValue(std::string(value)); } else { this->assignValue(std::string(value)); } }
     413
    80414#endif /* _MultiType_H__ */
  • code/trunk/src/util/UtilPrereqs.h

    r1735 r1747  
    6262class ArgReader;
    6363class Convert;
    64 class MultiTypePrimitive;
    65 class MultiTypeString;
    66 class MultiTypeMath;
    67 template <class T>
    68 class String2Number;
     64class ExprParser;
     65class MultiType;
    6966class SubString;
     67namespace orxonox
     68{
     69    class OutputBuffer;
     70    class OutputBufferListener;
     71    class Error;
     72    class OutputHandler;
     73}
     74
    7075#endif /* _UtilPrereqs_H__ */
  • code/trunk/visual_studio/core_properties.vsprops

    r1572 r1747  
    88        <Tool
    99                Name="VCCLCompilerTool"
     10                AdditionalOptions="/MP2"
    1011                PreprocessorDefinitions="CORE_SHARED_BUILD"
    1112        />
  • code/trunk/visual_studio/network_properties.vsprops

    r1293 r1747  
    88        <Tool
    99                Name="VCCLCompilerTool"
     10                AdditionalOptions="/MP2"
    1011                PreprocessorDefinitions="ORXONOX_NO_EXPORTS;NETWORK_STATIC_BUILD;WIN32_LEAN_AND_MEAN"
    1112        />
  • code/trunk/visual_studio/orxonox_properties.vsprops

    r1572 r1747  
    88        <Tool
    99                Name="VCCLCompilerTool"
     10                AdditionalOptions="/MP2"
    1011                PreprocessorDefinitions="ORXONOX_NO_EXPORTS;NETWORK_STATIC_BUILD"
    1112                UsePrecompiledHeader="2"
  • code/trunk/visual_studio/vc8/core.vcproj

    r1631 r1747  
    161161                        </File>
    162162                        <File
    163                                 RelativePath="..\..\src\core\Error.cc"
    164                                 >
    165                         </File>
    166                         <File
    167163                                RelativePath="..\..\src\core\Language.cc"
    168164                                >
     
    173169                        </File>
    174170                        <File
    175                                 RelativePath="..\..\src\core\OutputBuffer.cc"
    176                                 >
    177                         </File>
    178                         <File
    179                                 RelativePath="..\..\src\core\OutputHandler.cc"
    180                                 >
    181                         </File>
    182                         <File
    183171                                RelativePath="..\..\src\core\Script.cc"
    184                                 >
    185                         </File>
    186                         <File
    187                                 RelativePath="..\..\src\core\SignalHandler.cc"
    188172                                >
    189173                        </File>
     
    253237                                        >
    254238                                </File>
     239                                <File
     240                                        RelativePath="..\..\src\core\ObjectListBase.cc"
     241                                        >
     242                                </File>
    255243                        </Filter>
    256244                        <Filter
     
    365353                        </File>
    366354                        <File
    367                                 RelativePath="..\..\src\core\Debug.h"
    368                                 >
    369                         </File>
    370                         <File
    371                                 RelativePath="..\..\src\core\Error.h"
    372                                 >
    373                         </File>
    374                         <File
    375355                                RelativePath="..\..\src\core\Language.h"
    376356                                >
     
    381361                        </File>
    382362                        <File
    383                                 RelativePath="..\..\src\core\OutputBuffer.h"
    384                                 >
    385                         </File>
    386                         <File
    387                                 RelativePath="..\..\src\core\OutputHandler.h"
    388                                 >
    389                         </File>
    390                         <File
    391363                                RelativePath="..\..\src\core\Script.h"
    392364                                >
     
    397369                        </File>
    398370                        <File
    399                                 RelativePath="..\..\src\core\SignalHandler.h"
     371                                RelativePath="..\..\src\core\Super.h"
    400372                                >
    401373                        </File>
     
    524496                                </File>
    525497                                <File
     498                                        RelativePath="..\..\src\core\IteratorBase.h"
     499                                        >
     500                                </File>
     501                                <File
    526502                                        RelativePath="..\..\src\core\MetaObjectList.h"
    527503                                        >
     
    529505                                <File
    530506                                        RelativePath="..\..\src\core\ObjectList.h"
     507                                        >
     508                                </File>
     509                                <File
     510                                        RelativePath="..\..\src\core\ObjectListBase.h"
    531511                                        >
    532512                                </File>
  • code/trunk/visual_studio/vc8/orxonox.vcproj

    r1625 r1747  
    189189                        </File>
    190190                        <File
     191                                RelativePath="..\..\src\orxonox\SignalHandler.cc"
     192                                >
     193                        </File>
     194                        <Filter
     195                                Name="hud"
     196                        <File
    191197                                RelativePath="..\..\src\orxonox\RadarListener.cc"
    192198                                >
     
    558564                        <File
    559565                                RelativePath="..\..\src\orxonox\Settings.h"
     566                                >
     567                        </File>
     568                        <File
     569                                RelativePath="..\..\src\orxonox\SignalHandler.h"
    560570                                >
    561571                        </File>
  • code/trunk/visual_studio/vc8/util.vcproj

    r1735 r1747  
    161161                        </File>
    162162                        <File
     163                                RelativePath="..\..\src\util\Error.cc"
     164                                >
     165                        </File>
     166                        <File
    163167                                RelativePath="..\..\src\util\ExprParser.cc"
    164168                                >
     
    169173                        </File>
    170174                        <File
    171                                 RelativePath="..\..\src\util\MultiTypeMath.cc"
    172                                 >
    173                         </File>
    174                         <File
    175                                 RelativePath="..\..\src\util\MultiTypePrimitive.cc"
    176                                 >
    177                         </File>
    178                         <File
    179                                 RelativePath="..\..\src\util\MultiTypeString.cc"
     175                                RelativePath="..\..\src\util\MultiType.cc"
     176                                >
     177                        </File>
     178                        <File
     179                                RelativePath="..\..\src\util\OutputBuffer.cc"
     180                                >
     181                        </File>
     182                        <File
     183                                RelativePath="..\..\src\util\OutputHandler.cc"
    180184                                >
    181185                        </File>
     
    211215                        </File>
    212216                        <File
     217                                RelativePath="..\..\src\util\Debug.h"
     218                                >
     219                        </File>
     220                        <File
     221                                RelativePath="..\..\src\util\Error.h"
     222                                >
     223                        </File>
     224                        <File
    213225                                RelativePath="..\..\src\util\ExprParser.h"
    214226                                >
     
    223235                        </File>
    224236                        <File
    225                                 RelativePath="..\..\src\util\MultiTypeMath.h"
    226                                 >
    227                         </File>
    228                         <File
    229                                 RelativePath="..\..\src\util\MultiTypePrimitive.h"
    230                                 >
    231                         </File>
    232                         <File
    233                                 RelativePath="..\..\src\util\MultiTypeString.h"
     237                                RelativePath="..\..\src\util\MultiTypeValue.h"
    234238                                >
    235239                        </File>
    236240                        <File
    237241                                RelativePath="..\..\src\util\OrxonoxPlatform.h"
     242                                >
     243                        </File>
     244                        <File
     245                                RelativePath="..\..\src\util\OutputBuffer.h"
     246                                >
     247                        </File>
     248                        <File
     249                                RelativePath="..\..\src\util\OutputHandler.h"
    238250                                >
    239251                        </File>
Note: See TracChangeset for help on using the changeset viewer.