Changeset 794 for code/branches/core/src/util
- Timestamp:
- Feb 10, 2008, 1:05:27 AM (17 years ago)
- Location:
- code/branches/core/src/util
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core/src/util/MultiTypeMath.cc
r792 r794 45 45 } 46 46 47 MultiTypeMath::MultiTypeMath(const MultiTypeMath& mtm) 47 MultiTypeMath::MultiTypeMath(const MultiTypeMath& mtm) : MultiTypeString(mtm) 48 48 { 49 49 this->type_ = mtm.type_; -
code/branches/core/src/util/MultiTypeMath.h
r792 r794 39 39 public: 40 40 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); } 61 61 MultiTypeMath(const MultiTypeMath& mtm); 62 62 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; } 69 70 MultiTypeMath& operator=(const MultiTypeMath& mtm); 70 71 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); } 77 79 bool operator==(const MultiTypeMath& mtm) const; 78 80 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); } 85 88 bool operator!=(const MultiTypeMath& mtm) const; 86 89 90 using MultiTypeString::setValue; 87 91 inline void setValue(const orxonox::Vector2& value) { this->type_ = MT_vector2; this->vector2_ = value; } 88 92 inline void setValue(const orxonox::Vector3& value) { this->type_ = MT_vector3; this->vector3_ = value; } … … 100 104 inline orxonox::Degree& getDegree() { return this->degree_; } 101 105 106 using MultiTypeString::getValue; 102 107 inline void getValue(orxonox::Vector2* variable) const { (*variable) = orxonox::Vector2 (this->vector2_); } 103 108 inline void getValue(orxonox::Vector3* variable) const { (*variable) = orxonox::Vector3 (this->vector3_); } -
code/branches/core/src/util/MultiTypePrimitive.h
r792 r794 38 38 public: 39 39 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); } 52 52 MultiTypePrimitive(const MultiTypePrimitive& mtp); 53 53 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; } 66 66 MultiTypePrimitive& operator=(const MultiTypePrimitive& mtp); 67 67 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); } 80 80 bool operator==(const MultiTypePrimitive& mtp) const; 81 81 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); } 94 94 bool operator!=(const MultiTypePrimitive& mtp) const; 95 95 -
code/branches/core/src/util/MultiTypeString.cc
r792 r794 37 37 } 38 38 39 MultiTypeString::MultiTypeString(const MultiTypeString& mts) 39 MultiTypeString::MultiTypeString(const MultiTypeString& mts) : MultiTypePrimitive(mts) 40 40 { 41 41 this->type_ = mts.type_; -
code/branches/core/src/util/MultiTypeString.h
r792 r794 40 40 public: 41 41 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); } 56 56 MultiTypeString(const MultiTypeString& mtp); 57 57 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; } 60 61 MultiTypeString& operator=(const MultiTypeString& mtp); 61 62 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); } 64 66 bool operator==(const MultiTypeString& mtp) const; 65 67 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); } 68 71 bool operator!=(const MultiTypeString& mtp) const; 69 72 73 using MultiTypePrimitive::setValue; 70 74 inline void setValue(const char* value) { this->type_ = MT_string; this->string_ = std::string(value); } 71 75 inline void setValue(const std::string& value) { this->type_ = MT_string; this->string_ = value; } … … 74 78 inline std::string& getString() { return this->string_; } 75 79 80 using MultiTypePrimitive::getValue; 76 81 inline void getValue(std::string* variable) const { (*variable) = std::string(this->string_); } 77 82
Note: See TracChangeset
for help on using the changeset viewer.