Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 794


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
Files:
7 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; }
  • code/branches/core/src/util/MultiTypeMath.cc

    r792 r794  
    4545}
    4646
    47 MultiTypeMath::MultiTypeMath(const MultiTypeMath& mtm)
     47MultiTypeMath::MultiTypeMath(const MultiTypeMath& mtm) : MultiTypeString(mtm)
    4848{
    4949    this->type_ = mtm.type_;
  • code/branches/core/src/util/MultiTypeMath.h

    r792 r794  
    3939    public:
    4040        MultiTypeMath(MultiType      type = MT_null);
    41         MultiTypeMath(int            value) : MultiTypeString(value) {}
    42         MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
    43         MultiTypeMath(char           value) : MultiTypeString(value) {}
    44         MultiTypeMath(unsigned char  value) : MultiTypeString(value) {}
    45         MultiTypeMath(short          value) : MultiTypeString(value) {}
    46         MultiTypeMath(unsigned short value) : MultiTypeString(value) {}
    47         MultiTypeMath(long           value) : MultiTypeString(value) {}
    48         MultiTypeMath(unsigned long  value) : MultiTypeString(value) {}
    49         MultiTypeMath(float          value) : MultiTypeString(value) {}
    50         MultiTypeMath(double         value) : MultiTypeString(value) {}
    51         MultiTypeMath(long double    value) : MultiTypeString(value) {}
    52         MultiTypeMath(bool           value) : MultiTypeString(value) {}
    53         MultiTypeMath(const char*        value) : MultiTypeString(value) {}
    54         MultiTypeMath(const std::string& value) : MultiTypeString(value) {}
    55         MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }
    56         MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
    57         MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); }
    58         MultiTypeMath(const orxonox::Quaternion&  value) { this->setValue(value); }
    59         MultiTypeMath(const orxonox::Radian&      value) { this->setValue(value); }
    60         MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }
     41        inline MultiTypeMath(int            value) : MultiTypeString(value) {}
     42        inline MultiTypeMath(unsigned int   value) : MultiTypeString(value) {}
     43        inline MultiTypeMath(char           value) : MultiTypeString(value) {}
     44        inline MultiTypeMath(unsigned char  value) : MultiTypeString(value) {}
     45        inline MultiTypeMath(short          value) : MultiTypeString(value) {}
     46        inline MultiTypeMath(unsigned short value) : MultiTypeString(value) {}
     47        inline MultiTypeMath(long           value) : MultiTypeString(value) {}
     48        inline MultiTypeMath(unsigned long  value) : MultiTypeString(value) {}
     49        inline MultiTypeMath(float          value) : MultiTypeString(value) {}
     50        inline MultiTypeMath(double         value) : MultiTypeString(value) {}
     51        inline MultiTypeMath(long double    value) : MultiTypeString(value) {}
     52        inline MultiTypeMath(bool           value) : MultiTypeString(value) {}
     53        inline MultiTypeMath(const char*        value) : MultiTypeString(value) {}
     54        inline MultiTypeMath(const std::string& value) : MultiTypeString(value) {}
     55        inline MultiTypeMath(const orxonox::Vector2&     value) { this->setValue(value); }
     56        inline MultiTypeMath(const orxonox::Vector3&     value) { this->setValue(value); }
     57        inline MultiTypeMath(const orxonox::ColourValue& value) { this->setValue(value); }
     58        inline MultiTypeMath(const orxonox::Quaternion&  value) { this->setValue(value); }
     59        inline MultiTypeMath(const orxonox::Radian&      value) { this->setValue(value); }
     60        inline MultiTypeMath(const orxonox::Degree&      value) { this->setValue(value); }
    6161        MultiTypeMath(const MultiTypeMath& mtm);
    6262
    63         MultiTypeMath& operator=(const orxonox::Vector2&     value) { this->setValue(value); return *this; }
    64         MultiTypeMath& operator=(const orxonox::Vector3&     value) { this->setValue(value); return *this; }
    65         MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; }
    66         MultiTypeMath& operator=(const orxonox::Quaternion&  value) { this->setValue(value); return *this; }
    67         MultiTypeMath& operator=(const orxonox::Radian&      value) { this->setValue(value); return *this; }
    68         MultiTypeMath& operator=(const orxonox::Degree&      value) { this->setValue(value); return *this; }
     63        using MultiTypeString::operator=;
     64        inline MultiTypeMath& operator=(const orxonox::Vector2&     value) { this->setValue(value); return *this; }
     65        inline MultiTypeMath& operator=(const orxonox::Vector3&     value) { this->setValue(value); return *this; }
     66        inline MultiTypeMath& operator=(const orxonox::ColourValue& value) { this->setValue(value); return *this; }
     67        inline MultiTypeMath& operator=(const orxonox::Quaternion&  value) { this->setValue(value); return *this; }
     68        inline MultiTypeMath& operator=(const orxonox::Radian&      value) { this->setValue(value); return *this; }
     69        inline MultiTypeMath& operator=(const orxonox::Degree&      value) { this->setValue(value); return *this; }
    6970        MultiTypeMath& operator=(const MultiTypeMath& mtm);
    7071
    71         bool operator==(const orxonox::Vector2&     value) const { return (this->vector2_     == value); }
    72         bool operator==(const orxonox::Vector3&     value) const { return (this->vector3_     == value); }
    73         bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); }
    74         bool operator==(const orxonox::Quaternion&  value) const { return (this->quaternion_  == value); }
    75         bool operator==(const orxonox::Radian&      value) const { return (this->radian_      == value); }
    76         bool operator==(const orxonox::Degree&      value) const { return (this->degree_      == value); }
     72        using MultiTypeString::operator==;
     73        inline bool operator==(const orxonox::Vector2&     value) const { return (this->vector2_     == value); }
     74        inline bool operator==(const orxonox::Vector3&     value) const { return (this->vector3_     == value); }
     75        inline bool operator==(const orxonox::ColourValue& value) const { return (this->colourvalue_ == value); }
     76        inline bool operator==(const orxonox::Quaternion&  value) const { return (this->quaternion_  == value); }
     77        inline bool operator==(const orxonox::Radian&      value) const { return (this->radian_      == value); }
     78        inline bool operator==(const orxonox::Degree&      value) const { return (this->degree_      == value); }
    7779        bool operator==(const MultiTypeMath& mtm) const;
    7880
    79         bool operator!=(const orxonox::Vector2&     value) const { return (this->vector2_     != value); }
    80         bool operator!=(const orxonox::Vector3&     value) const { return (this->vector3_     != value); }
    81         bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); }
    82         bool operator!=(const orxonox::Quaternion&  value) const { return (this->quaternion_  != value); }
    83         bool operator!=(const orxonox::Radian&      value) const { return (this->radian_      != value); }
    84         bool operator!=(const orxonox::Degree&      value) const { return (this->degree_      != value); }
     81        using MultiTypeString::operator!=;
     82        inline bool operator!=(const orxonox::Vector2&     value) const { return (this->vector2_     != value); }
     83        inline bool operator!=(const orxonox::Vector3&     value) const { return (this->vector3_     != value); }
     84        inline bool operator!=(const orxonox::ColourValue& value) const { return (this->colourvalue_ != value); }
     85        inline bool operator!=(const orxonox::Quaternion&  value) const { return (this->quaternion_  != value); }
     86        inline bool operator!=(const orxonox::Radian&      value) const { return (this->radian_      != value); }
     87        inline bool operator!=(const orxonox::Degree&      value) const { return (this->degree_      != value); }
    8588        bool operator!=(const MultiTypeMath& mtm) const;
    8689
     90        using MultiTypeString::setValue;
    8791        inline void setValue(const orxonox::Vector2&     value) { this->type_ = MT_vector2;     this->vector2_     = value; }
    8892        inline void setValue(const orxonox::Vector3&     value) { this->type_ = MT_vector3;     this->vector3_     = value; }
     
    100104        inline orxonox::Degree&      getDegree()      { return this->degree_;      }
    101105
     106        using MultiTypeString::getValue;
    102107        inline void getValue(orxonox::Vector2*     variable) const { (*variable) = orxonox::Vector2     (this->vector2_);     }
    103108        inline void getValue(orxonox::Vector3*     variable) const { (*variable) = orxonox::Vector3     (this->vector3_);     }
  • code/branches/core/src/util/MultiTypePrimitive.h

    r792 r794  
    3838    public:
    3939        MultiTypePrimitive(MultiType      type = MT_null);
    40         MultiTypePrimitive(int            value) { this->setValue(value); }
    41         MultiTypePrimitive(unsigned int   value) { this->setValue(value); }
    42         MultiTypePrimitive(char           value) { this->setValue(value); }
    43         MultiTypePrimitive(unsigned char  value) { this->setValue(value); }
    44         MultiTypePrimitive(short          value) { this->setValue(value); }
    45         MultiTypePrimitive(unsigned short value) { this->setValue(value); }
    46         MultiTypePrimitive(long           value) { this->setValue(value); }
    47         MultiTypePrimitive(unsigned long  value) { this->setValue(value); }
    48         MultiTypePrimitive(float          value) { this->setValue(value); }
    49         MultiTypePrimitive(double         value) { this->setValue(value); }
    50         MultiTypePrimitive(long double    value) { this->setValue(value); }
    51         MultiTypePrimitive(bool           value) { this->setValue(value); }
     40        inline MultiTypePrimitive(int            value) { this->setValue(value); }
     41        inline MultiTypePrimitive(unsigned int   value) { this->setValue(value); }
     42        inline MultiTypePrimitive(char           value) { this->setValue(value); }
     43        inline MultiTypePrimitive(unsigned char  value) { this->setValue(value); }
     44        inline MultiTypePrimitive(short          value) { this->setValue(value); }
     45        inline MultiTypePrimitive(unsigned short value) { this->setValue(value); }
     46        inline MultiTypePrimitive(long           value) { this->setValue(value); }
     47        inline MultiTypePrimitive(unsigned long  value) { this->setValue(value); }
     48        inline MultiTypePrimitive(float          value) { this->setValue(value); }
     49        inline MultiTypePrimitive(double         value) { this->setValue(value); }
     50        inline MultiTypePrimitive(long double    value) { this->setValue(value); }
     51        inline MultiTypePrimitive(bool           value) { this->setValue(value); }
    5252        MultiTypePrimitive(const MultiTypePrimitive& mtp);
    5353
    54         MultiTypePrimitive& operator=(int            value) { this->setValue(value); return *this; }
    55         MultiTypePrimitive& operator=(unsigned int   value) { this->setValue(value); return *this; }
    56         MultiTypePrimitive& operator=(char           value) { this->setValue(value); return *this; }
    57         MultiTypePrimitive& operator=(unsigned char  value) { this->setValue(value); return *this; }
    58         MultiTypePrimitive& operator=(short          value) { this->setValue(value); return *this; }
    59         MultiTypePrimitive& operator=(unsigned short value) { this->setValue(value); return *this; }
    60         MultiTypePrimitive& operator=(long           value) { this->setValue(value); return *this; }
    61         MultiTypePrimitive& operator=(unsigned long  value) { this->setValue(value); return *this; }
    62         MultiTypePrimitive& operator=(float          value) { this->setValue(value); return *this; }
    63         MultiTypePrimitive& operator=(double         value) { this->setValue(value); return *this; }
    64         MultiTypePrimitive& operator=(long double    value) { this->setValue(value); return *this; }
    65         MultiTypePrimitive& operator=(bool           value) { this->setValue(value); return *this; }
     54        inline MultiTypePrimitive& operator=(int            value) { this->setValue(value); return *this; }
     55        inline MultiTypePrimitive& operator=(unsigned int   value) { this->setValue(value); return *this; }
     56        inline MultiTypePrimitive& operator=(char           value) { this->setValue(value); return *this; }
     57        inline MultiTypePrimitive& operator=(unsigned char  value) { this->setValue(value); return *this; }
     58        inline MultiTypePrimitive& operator=(short          value) { this->setValue(value); return *this; }
     59        inline MultiTypePrimitive& operator=(unsigned short value) { this->setValue(value); return *this; }
     60        inline MultiTypePrimitive& operator=(long           value) { this->setValue(value); return *this; }
     61        inline MultiTypePrimitive& operator=(unsigned long  value) { this->setValue(value); return *this; }
     62        inline MultiTypePrimitive& operator=(float          value) { this->setValue(value); return *this; }
     63        inline MultiTypePrimitive& operator=(double         value) { this->setValue(value); return *this; }
     64        inline MultiTypePrimitive& operator=(long double    value) { this->setValue(value); return *this; }
     65        inline MultiTypePrimitive& operator=(bool           value) { this->setValue(value); return *this; }
    6666        MultiTypePrimitive& operator=(const MultiTypePrimitive& mtp);
    6767
    68         bool operator==(int            value) const { return (this->value_.int_        == value); }
    69         bool operator==(unsigned int   value) const { return (this->value_.uint_       == value); }
    70         bool operator==(char           value) const { return (this->value_.char_       == value); }
    71         bool operator==(unsigned char  value) const { return (this->value_.uchar_      == value); }
    72         bool operator==(short          value) const { return (this->value_.short_      == value); }
    73         bool operator==(unsigned short value) const { return (this->value_.ushort_     == value); }
    74         bool operator==(long           value) const { return (this->value_.long_       == value); }
    75         bool operator==(unsigned long  value) const { return (this->value_.ulong_      == value); }
    76         bool operator==(float          value) const { return (this->value_.float_      == value); }
    77         bool operator==(double         value) const { return (this->value_.double_     == value); }
    78         bool operator==(long double    value) const { return (this->value_.longdouble_ == value); }
    79         bool operator==(bool           value) const { return (this->value_.bool_       == value); }
     68        inline bool operator==(int            value) const { return (this->value_.int_        == value); }
     69        inline bool operator==(unsigned int   value) const { return (this->value_.uint_       == value); }
     70        inline bool operator==(char           value) const { return (this->value_.char_       == value); }
     71        inline bool operator==(unsigned char  value) const { return (this->value_.uchar_      == value); }
     72        inline bool operator==(short          value) const { return (this->value_.short_      == value); }
     73        inline bool operator==(unsigned short value) const { return (this->value_.ushort_     == value); }
     74        inline bool operator==(long           value) const { return (this->value_.long_       == value); }
     75        inline bool operator==(unsigned long  value) const { return (this->value_.ulong_      == value); }
     76        inline bool operator==(float          value) const { return (this->value_.float_      == value); }
     77        inline bool operator==(double         value) const { return (this->value_.double_     == value); }
     78        inline bool operator==(long double    value) const { return (this->value_.longdouble_ == value); }
     79        inline bool operator==(bool           value) const { return (this->value_.bool_       == value); }
    8080        bool operator==(const MultiTypePrimitive& mtp) const;
    8181
    82         bool operator!=(int            value) const { return (this->value_.int_        != value); }
    83         bool operator!=(unsigned int   value) const { return (this->value_.uint_       != value); }
    84         bool operator!=(char           value) const { return (this->value_.char_       != value); }
    85         bool operator!=(unsigned char  value) const { return (this->value_.uchar_      != value); }
    86         bool operator!=(short          value) const { return (this->value_.short_      != value); }
    87         bool operator!=(unsigned short value) const { return (this->value_.ushort_     != value); }
    88         bool operator!=(long           value) const { return (this->value_.long_       != value); }
    89         bool operator!=(unsigned long  value) const { return (this->value_.ulong_      != value); }
    90         bool operator!=(float          value) const { return (this->value_.float_      != value); }
    91         bool operator!=(double         value) const { return (this->value_.double_     != value); }
    92         bool operator!=(long double    value) const { return (this->value_.longdouble_ != value); }
    93         bool operator!=(bool           value) const { return (this->value_.bool_       != value); }
     82        inline bool operator!=(int            value) const { return (this->value_.int_        != value); }
     83        inline bool operator!=(unsigned int   value) const { return (this->value_.uint_       != value); }
     84        inline bool operator!=(char           value) const { return (this->value_.char_       != value); }
     85        inline bool operator!=(unsigned char  value) const { return (this->value_.uchar_      != value); }
     86        inline bool operator!=(short          value) const { return (this->value_.short_      != value); }
     87        inline bool operator!=(unsigned short value) const { return (this->value_.ushort_     != value); }
     88        inline bool operator!=(long           value) const { return (this->value_.long_       != value); }
     89        inline bool operator!=(unsigned long  value) const { return (this->value_.ulong_      != value); }
     90        inline bool operator!=(float          value) const { return (this->value_.float_      != value); }
     91        inline bool operator!=(double         value) const { return (this->value_.double_     != value); }
     92        inline bool operator!=(long double    value) const { return (this->value_.longdouble_ != value); }
     93        inline bool operator!=(bool           value) const { return (this->value_.bool_       != value); }
    9494        bool operator!=(const MultiTypePrimitive& mtp) const;
    9595
  • code/branches/core/src/util/MultiTypeString.cc

    r792 r794  
    3737}
    3838
    39 MultiTypeString::MultiTypeString(const MultiTypeString& mts)
     39MultiTypeString::MultiTypeString(const MultiTypeString& mts) : MultiTypePrimitive(mts)
    4040{
    4141    this->type_ = mts.type_;
  • code/branches/core/src/util/MultiTypeString.h

    r792 r794  
    4040    public:
    4141        MultiTypeString(MultiType      type = MT_null);
    42         MultiTypeString(int            value) : MultiTypePrimitive(value) {}
    43         MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
    44         MultiTypeString(char           value) : MultiTypePrimitive(value) {}
    45         MultiTypeString(unsigned char  value) : MultiTypePrimitive(value) {}
    46         MultiTypeString(short          value) : MultiTypePrimitive(value) {}
    47         MultiTypeString(unsigned short value) : MultiTypePrimitive(value) {}
    48         MultiTypeString(long           value) : MultiTypePrimitive(value) {}
    49         MultiTypeString(unsigned long  value) : MultiTypePrimitive(value) {}
    50         MultiTypeString(float          value) : MultiTypePrimitive(value) {}
    51         MultiTypeString(double         value) : MultiTypePrimitive(value) {}
    52         MultiTypeString(long double    value) : MultiTypePrimitive(value) {}
    53         MultiTypeString(bool           value) : MultiTypePrimitive(value) {}
    54         MultiTypeString(const char*        value) { this->setValue(value); }
    55         MultiTypeString(const std::string& value) { this->setValue(value); }
     42        inline MultiTypeString(int            value) : MultiTypePrimitive(value) {}
     43        inline MultiTypeString(unsigned int   value) : MultiTypePrimitive(value) {}
     44        inline MultiTypeString(char           value) : MultiTypePrimitive(value) {}
     45        inline MultiTypeString(unsigned char  value) : MultiTypePrimitive(value) {}
     46        inline MultiTypeString(short          value) : MultiTypePrimitive(value) {}
     47        inline MultiTypeString(unsigned short value) : MultiTypePrimitive(value) {}
     48        inline MultiTypeString(long           value) : MultiTypePrimitive(value) {}
     49        inline MultiTypeString(unsigned long  value) : MultiTypePrimitive(value) {}
     50        inline MultiTypeString(float          value) : MultiTypePrimitive(value) {}
     51        inline MultiTypeString(double         value) : MultiTypePrimitive(value) {}
     52        inline MultiTypeString(long double    value) : MultiTypePrimitive(value) {}
     53        inline MultiTypeString(bool           value) : MultiTypePrimitive(value) {}
     54        inline MultiTypeString(const char*        value) { this->setValue(value); }
     55        inline MultiTypeString(const std::string& value) { this->setValue(value); }
    5656        MultiTypeString(const MultiTypeString& mtp);
    5757
    58         MultiTypeString& operator=(const char*        value) { this->setValue(value); return *this; }
    59         MultiTypeString& operator=(const std::string& value) { this->setValue(value); return *this; }
     58        using MultiTypePrimitive::operator=;
     59        inline MultiTypeString& operator=(const char*        value) { this->setValue(value); return *this; }
     60        inline MultiTypeString& operator=(const std::string& value) { this->setValue(value); return *this; }
    6061        MultiTypeString& operator=(const MultiTypeString& mtp);
    6162
    62         bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }
    63         bool operator==(const std::string& value) const { return (this->string_ == value); }
     63        using MultiTypePrimitive::operator==;
     64        inline bool operator==(const char*        value) const { return (this->string_ == std::string(value)); }
     65        inline bool operator==(const std::string& value) const { return (this->string_ == value); }
    6466        bool operator==(const MultiTypeString& mtp) const;
    6567
    66         bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }
    67         bool operator!=(const std::string& value) const { return (this->string_ != value); }
     68        using MultiTypePrimitive::operator!=;
     69        inline bool operator!=(const char*        value) const { return (this->string_ != std::string(value)); }
     70        inline bool operator!=(const std::string& value) const { return (this->string_ != value); }
    6871        bool operator!=(const MultiTypeString& mtp) const;
    6972
     73        using MultiTypePrimitive::setValue;
    7074        inline void setValue(const char*        value) { this->type_ = MT_string; this->string_ = std::string(value); }
    7175        inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value; }
     
    7478        inline std::string& getString() { return this->string_; }
    7579
     80        using MultiTypePrimitive::getValue;
    7681        inline void getValue(std::string* variable) const { (*variable) = std::string(this->string_); }
    7782
Note: See TracChangeset for help on using the changeset viewer.