Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 10, 2008, 1:05:27 AM (16 years ago)
Author:
landauf
Message:

fixed a strange problem in the MultiType-classes

read this if you're interested:
http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&faq=Overload#Answ

Location:
code/branches/core/src/orxonox/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/orxonox/core/ConfigValueContainer.cc

    r792 r794  
    231231        int temp;
    232232        bool success = ConvertValue(&temp, input, defvalue);
    233         ((MultiTypePrimitive)this->value_).setValue(temp);
     233        this->value_.setValue(temp);
    234234        return success;
    235235    }
     
    245245        unsigned int temp;
    246246        bool success = ConvertValue(&temp, input, defvalue);
    247         ((MultiTypePrimitive)this->value_).setValue(temp);
     247        this->value_.setValue(temp);
    248248        return success;
    249249    }
     
    260260        int temp;
    261261        bool success = ConvertValue(&temp, input, (int)defvalue);
    262         ((MultiTypePrimitive)this->value_).setValue((char)temp);
     262        this->value_.setValue((char)temp);
    263263        return success;
    264264    }
     
    275275        unsigned int temp;
    276276        bool success = ConvertValue(&temp, input, (unsigned int)defvalue);
    277         ((MultiTypePrimitive)this->value_).setValue((unsigned char)temp);
     277        this->value_.setValue((unsigned char)temp);
    278278        return success;
    279279    }
     
    289289        short temp;
    290290        bool success = ConvertValue(&temp, input, defvalue);
    291         ((MultiTypePrimitive)this->value_).setValue(temp);
     291        this->value_.setValue(temp);
    292292        return success;
    293293    }
     
    303303        unsigned short temp;
    304304        bool success = ConvertValue(&temp, input, defvalue);
    305         ((MultiTypePrimitive)this->value_).setValue(temp);
     305        this->value_.setValue(temp);
    306306        return success;
    307307    }
     
    317317        long temp;
    318318        bool success = ConvertValue(&temp, input, defvalue);
    319         ((MultiTypePrimitive)this->value_).setValue(temp);
     319        this->value_.setValue(temp);
    320320        return success;
    321321    }
     
    331331        unsigned long temp;
    332332        bool success = ConvertValue(&temp, input, defvalue);
    333         ((MultiTypePrimitive)this->value_).setValue(temp);
     333        this->value_.setValue(temp);
    334334        return success;
    335335    }
     
    345345        float temp;
    346346        bool success = ConvertValue(&temp, input, defvalue);
    347         ((MultiTypePrimitive)this->value_).setValue(temp);
     347        this->value_.setValue(temp);
    348348        return success;
    349349    }
     
    359359        double temp;
    360360        bool success = ConvertValue(&temp, input, defvalue);
    361         ((MultiTypePrimitive)this->value_).setValue(temp);
     361        this->value_.setValue(temp);
    362362        return success;
    363363    }
     
    373373        long double temp;
    374374        bool success = ConvertValue(&temp, input, defvalue);
    375         ((MultiTypePrimitive)this->value_).setValue(temp);
     375        this->value_.setValue(temp);
    376376        return success;
    377377    }
     
    390390         || input.find("yes") < input.size()
    391391         || input.find("Yes") < input.size())
    392             ((MultiTypePrimitive)this->value_).setValue(true);
     392            this->value_.setValue(true);
    393393        else if (input.find("false") < input.size()
    394394              || input.find("False") < input.size()
    395395              || input.find("no") < input.size()
    396396              || input.find("No") < input.size())
    397             ((MultiTypePrimitive)this->value_).setValue(false);
     397            this->value_.setValue(false);
    398398        else
    399399        {
     
    401401            bool temp;
    402402            bool success = ConvertValue(&temp, input, defvalue);
    403             ((MultiTypePrimitive)this->value_).setValue(temp);
     403            this->value_.setValue(temp);
    404404            return success;
    405405        }
  • code/branches/core/src/orxonox/core/ConfigValueContainer.h

    r792 r794  
    7979            inline ConfigValueContainer& getValue(T& value)                           { this->value_.getValue(value); return *this; }
    8080*/
    81             inline ConfigValueContainer& getValue(int* value)            { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    82             inline ConfigValueContainer& getValue(unsigned int* value)   { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    83             inline ConfigValueContainer& getValue(char* value)           { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    84             inline ConfigValueContainer& getValue(unsigned char* value)  { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    85             inline ConfigValueContainer& getValue(short* value)          { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    86             inline ConfigValueContainer& getValue(unsigned short* value) { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    87             inline ConfigValueContainer& getValue(long* value)           { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    88             inline ConfigValueContainer& getValue(unsigned long* value)  { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    89             inline ConfigValueContainer& getValue(float* value)          { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    90             inline ConfigValueContainer& getValue(double* value)         { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    91             inline ConfigValueContainer& getValue(long double* value)    { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    92             inline ConfigValueContainer& getValue(bool* value)           { ((MultiTypePrimitive)this->value_).getValue(value); return *this; }
    93             inline ConfigValueContainer& getValue(std::string* value)    { ((MultiTypeString)this->value_).getValue(value); return *this; }
     81            inline ConfigValueContainer& getValue(int* value)            { this->value_.getValue(value); return *this; }
     82            inline ConfigValueContainer& getValue(unsigned int* value)   { this->value_.getValue(value); return *this; }
     83            inline ConfigValueContainer& getValue(char* value)           { this->value_.getValue(value); return *this; }
     84            inline ConfigValueContainer& getValue(unsigned char* value)  { this->value_.getValue(value); return *this; }
     85            inline ConfigValueContainer& getValue(short* value)          { this->value_.getValue(value); return *this; }
     86            inline ConfigValueContainer& getValue(unsigned short* value) { this->value_.getValue(value); return *this; }
     87            inline ConfigValueContainer& getValue(long* value)           { this->value_.getValue(value); return *this; }
     88            inline ConfigValueContainer& getValue(unsigned long* value)  { this->value_.getValue(value); return *this; }
     89            inline ConfigValueContainer& getValue(float* value)          { this->value_.getValue(value); return *this; }
     90            inline ConfigValueContainer& getValue(double* value)         { this->value_.getValue(value); return *this; }
     91            inline ConfigValueContainer& getValue(long double* value)    { this->value_.getValue(value); return *this; }
     92            inline ConfigValueContainer& getValue(bool* value)           { this->value_.getValue(value); return *this; }
     93            inline ConfigValueContainer& getValue(std::string* value)    { this->value_.getValue(value); return *this; }
    9494            inline ConfigValueContainer& getValue(Vector2* value)        { this->value_.getValue(value); return *this; }
    9595            inline ConfigValueContainer& getValue(Vector3* value)        { this->value_.getValue(value); return *this; }
Note: See TracChangeset for help on using the changeset viewer.