Changeset 7401 for code/trunk/src/libraries/util/MultiTypeValue.h
- Timestamp:
- Sep 11, 2010, 12:34:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/doc (added) merged: 7290-7292,7296-7300,7302-7304,7306-7312,7315-7318,7323,7325,7327,7331-7332,7334-7335,7345-7347,7352-7353,7356-7357,7361,7363-7367,7371-7375,7388
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/MultiTypeValue.h
r6417 r7401 29 29 /** 30 30 @file 31 @ingroup MultiType 31 32 @brief Declaration and Implementation of the MT_Value<T> class. 32 33 … … 53 54 { 54 55 public: 55 / ** @brief Constructor: Assigns the value and the type identifier. */56 /// Constructor: Assigns the value and the type identifier. 56 57 MT_Value(const T& value, MT_Type::Value type) : MT_ValueBase(type), value_(value) {} 57 58 58 / ** @brief Creates a copy of itself. */59 /// Creates a copy of itself. 59 60 inline MT_ValueBase* clone() const { return new MT_Value<T>(this->value_, this->type_); } 60 61 61 / ** @brief Resets the current value to the default. */62 /// Resets the current value to the default. 62 63 inline void reset() { this->value_ = zeroise<T>(); bHasDefaultValue_ = true; } 63 64 64 /** @brief Assigns the value of the other MultiType, converted to T. @param other The other MultiType */ 65 /** 66 @brief Assigns the value of the other MultiType, converted to T. 67 @param other The other MultiType 68 */ 65 69 inline bool assimilate(const MultiType& other) 66 70 { … … 76 80 } 77 81 78 inline bool getValue(char* value) const { return convertValue<T, char >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */79 inline bool getValue(unsigned char* value) const { return convertValue<T, unsigned char >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */80 inline bool getValue(short* value) const { return convertValue<T, short >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */81 inline bool getValue(unsigned short* value) const { return convertValue<T, unsigned short >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */82 inline bool getValue(int* value) const { return convertValue<T, int >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */83 inline bool getValue(unsigned int* value) const { return convertValue<T, unsigned int >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */84 inline bool getValue(long* value) const { return convertValue<T, long >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */85 inline bool getValue(unsigned long* value) const { return convertValue<T, unsigned long >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */86 inline bool getValue(long long* value) const { return convertValue<T, long long >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */87 inline bool getValue(unsigned long long* value) const { return convertValue<T, unsigned long long >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */88 inline bool getValue(float* value) const { return convertValue<T, float >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */89 inline bool getValue(double* value) const { return convertValue<T, double >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */90 inline bool getValue(long double* value) const { return convertValue<T, long double >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */91 inline bool getValue(bool* value) const { return convertValue<T, bool >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */92 inline bool getValue(void** value) const { return convertValue<T, void* >(value, value_, 0); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */93 inline bool getValue(std::string* value) const { return convertValue<T, std::string >(value, value_, zeroise<std::string> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */94 inline bool getValue(orxonox::Vector2* value) const { return convertValue<T, orxonox::Vector2 >(value, value_, zeroise<orxonox::Vector2> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */95 inline bool getValue(orxonox::Vector3* value) const { return convertValue<T, orxonox::Vector3 >(value, value_, zeroise<orxonox::Vector3> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */96 inline bool getValue(orxonox::Vector4* value) const { return convertValue<T, orxonox::Vector4 >(value, value_, zeroise<orxonox::Vector4> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */97 inline bool getValue(orxonox::ColourValue* value) const { return convertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */98 inline bool getValue(orxonox::Quaternion* value) const { return convertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */99 inline bool getValue(orxonox::Radian* value) const { return convertValue<T, orxonox::Radian >(value, value_, zeroise<orxonox::Radian> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */100 inline bool getValue(orxonox::Degree* value) const { return convertValue<T, orxonox::Degree >(value, value_, zeroise<orxonox::Degree> ()); } / ** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */101 102 inline bool setValue(const char& value) { return !(bHasDefaultValue_ = !convertValue<char , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */103 inline bool setValue(const unsigned char& value) { return !(bHasDefaultValue_ = !convertValue<unsigned char , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */104 inline bool setValue(const short& value) { return !(bHasDefaultValue_ = !convertValue<short , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */105 inline bool setValue(const unsigned short& value) { return !(bHasDefaultValue_ = !convertValue<unsigned short , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */106 inline bool setValue(const int& value) { return !(bHasDefaultValue_ = !convertValue<int , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */107 inline bool setValue(const unsigned int& value) { return !(bHasDefaultValue_ = !convertValue<unsigned int , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */108 inline bool setValue(const long& value) { return !(bHasDefaultValue_ = !convertValue<long , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */109 inline bool setValue(const unsigned long& value) { return !(bHasDefaultValue_ = !convertValue<unsigned long , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */110 inline bool setValue(const long long& value) { return !(bHasDefaultValue_ = !convertValue<long long , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */111 inline bool setValue(const unsigned long long& value) { return !(bHasDefaultValue_ = !convertValue<unsigned long long , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */112 inline bool setValue(const float& value) { return !(bHasDefaultValue_ = !convertValue<float , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */113 inline bool setValue(const double& value) { return !(bHasDefaultValue_ = !convertValue<double , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */114 inline bool setValue(const long double& value) { return !(bHasDefaultValue_ = !convertValue<long double , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */115 inline bool setValue(const bool& value) { return !(bHasDefaultValue_ = !convertValue<bool , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */116 inline bool setValue( void* const& value) { return !(bHasDefaultValue_ = !convertValue<void* , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */117 inline bool setValue(const std::string& value) { return !(bHasDefaultValue_ = !convertValue<std::string , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */118 inline bool setValue(const orxonox::Vector2& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector2 , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */119 inline bool setValue(const orxonox::Vector3& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector3 , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */120 inline bool setValue(const orxonox::Vector4& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector4 , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */121 inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */122 inline bool setValue(const orxonox::Quaternion& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */123 inline bool setValue(const orxonox::Radian& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Radian , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */124 inline bool setValue(const orxonox::Degree& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Degree , T>(&value_, value, zeroise<T>())); } / ** @brief Assigns the value by converting it to T. */125 126 inline operator char() const { return getConvertedValue<T, char> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */127 inline operator unsigned char() const { return getConvertedValue<T, unsigned char> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */128 inline operator short() const { return getConvertedValue<T, short> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */129 inline operator unsigned short() const { return getConvertedValue<T, unsigned short> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */130 inline operator int() const { return getConvertedValue<T, int> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */131 inline operator unsigned int() const { return getConvertedValue<T, unsigned int> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */132 inline operator long() const { return getConvertedValue<T, long> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */133 inline operator unsigned long() const { return getConvertedValue<T, unsigned long> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */134 inline operator long long() const { return getConvertedValue<T, long long> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */135 inline operator unsigned long long() const { return getConvertedValue<T, unsigned long long> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */136 inline operator float() const { return getConvertedValue<T, float> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */137 inline operator double() const { return getConvertedValue<T, double> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */138 inline operator long double() const { return getConvertedValue<T, long double> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */139 inline operator bool() const { return getConvertedValue<T, bool> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */140 inline operator void*() const { return getConvertedValue<T, void*> (this->value_, 0); } / ** @brief Returns the current value, converted to the requested type. */141 inline operator std::string() const { return getConvertedValue<T, std::string> (this->value_, NilValue<std::string >()); } / ** @brief Returns the current value, converted to the requested type. */142 inline operator orxonox::Vector2() const { return getConvertedValue<T, orxonox::Vector2> (this->value_, NilValue<orxonox::Vector2 >()); } / ** @brief Returns the current value, converted to the requested type. */143 inline operator orxonox::Vector3() const { return getConvertedValue<T, orxonox::Vector3> (this->value_, NilValue<orxonox::Vector3 >()); } / ** @brief Returns the current value, converted to the requested type. */144 inline operator orxonox::Vector4() const { return getConvertedValue<T, orxonox::Vector4> (this->value_, NilValue<orxonox::Vector4 >()); } / ** @brief Returns the current value, converted to the requested type. */145 inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, NilValue<orxonox::ColourValue>()); } / ** @brief Returns the current value, converted to the requested type. */146 inline operator orxonox::Quaternion() const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, NilValue<orxonox::Quaternion >()); } / ** @brief Returns the current value, converted to the requested type. */147 inline operator orxonox::Radian() const { return getConvertedValue<T, orxonox::Radian> (this->value_, NilValue<orxonox::Radian >()); } / ** @brief Returns the current value, converted to the requested type. */148 inline operator orxonox::Degree() const { return getConvertedValue<T, orxonox::Degree> (this->value_, NilValue<orxonox::Degree >()); } / ** @brief Returns the current value, converted to the requested type. */149 150 / ** @brief Puts the current value on the stream */82 inline bool getValue(char* value) const { return convertValue<T, char >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 83 inline bool getValue(unsigned char* value) const { return convertValue<T, unsigned char >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 84 inline bool getValue(short* value) const { return convertValue<T, short >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 85 inline bool getValue(unsigned short* value) const { return convertValue<T, unsigned short >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 86 inline bool getValue(int* value) const { return convertValue<T, int >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 87 inline bool getValue(unsigned int* value) const { return convertValue<T, unsigned int >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 88 inline bool getValue(long* value) const { return convertValue<T, long >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 89 inline bool getValue(unsigned long* value) const { return convertValue<T, unsigned long >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 90 inline bool getValue(long long* value) const { return convertValue<T, long long >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 91 inline bool getValue(unsigned long long* value) const { return convertValue<T, unsigned long long >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 92 inline bool getValue(float* value) const { return convertValue<T, float >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 93 inline bool getValue(double* value) const { return convertValue<T, double >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 94 inline bool getValue(long double* value) const { return convertValue<T, long double >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 95 inline bool getValue(bool* value) const { return convertValue<T, bool >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 96 inline bool getValue(void** value) const { return convertValue<T, void* >(value, value_, 0); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 97 inline bool getValue(std::string* value) const { return convertValue<T, std::string >(value, value_, zeroise<std::string> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 98 inline bool getValue(orxonox::Vector2* value) const { return convertValue<T, orxonox::Vector2 >(value, value_, zeroise<orxonox::Vector2> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 99 inline bool getValue(orxonox::Vector3* value) const { return convertValue<T, orxonox::Vector3 >(value, value_, zeroise<orxonox::Vector3> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 100 inline bool getValue(orxonox::Vector4* value) const { return convertValue<T, orxonox::Vector4 >(value, value_, zeroise<orxonox::Vector4> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 101 inline bool getValue(orxonox::ColourValue* value) const { return convertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 102 inline bool getValue(orxonox::Quaternion* value) const { return convertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 103 inline bool getValue(orxonox::Radian* value) const { return convertValue<T, orxonox::Radian >(value, value_, zeroise<orxonox::Radian> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 104 inline bool getValue(orxonox::Degree* value) const { return convertValue<T, orxonox::Degree >(value, value_, zeroise<orxonox::Degree> ()); } ///< Assigns the value to the given pointer. The value gets converted if the types don't match. 105 106 inline bool setValue(const char& value) { return !(bHasDefaultValue_ = !convertValue<char , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 107 inline bool setValue(const unsigned char& value) { return !(bHasDefaultValue_ = !convertValue<unsigned char , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 108 inline bool setValue(const short& value) { return !(bHasDefaultValue_ = !convertValue<short , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 109 inline bool setValue(const unsigned short& value) { return !(bHasDefaultValue_ = !convertValue<unsigned short , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 110 inline bool setValue(const int& value) { return !(bHasDefaultValue_ = !convertValue<int , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 111 inline bool setValue(const unsigned int& value) { return !(bHasDefaultValue_ = !convertValue<unsigned int , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 112 inline bool setValue(const long& value) { return !(bHasDefaultValue_ = !convertValue<long , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 113 inline bool setValue(const unsigned long& value) { return !(bHasDefaultValue_ = !convertValue<unsigned long , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 114 inline bool setValue(const long long& value) { return !(bHasDefaultValue_ = !convertValue<long long , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 115 inline bool setValue(const unsigned long long& value) { return !(bHasDefaultValue_ = !convertValue<unsigned long long , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 116 inline bool setValue(const float& value) { return !(bHasDefaultValue_ = !convertValue<float , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 117 inline bool setValue(const double& value) { return !(bHasDefaultValue_ = !convertValue<double , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 118 inline bool setValue(const long double& value) { return !(bHasDefaultValue_ = !convertValue<long double , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 119 inline bool setValue(const bool& value) { return !(bHasDefaultValue_ = !convertValue<bool , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 120 inline bool setValue( void* const& value) { return !(bHasDefaultValue_ = !convertValue<void* , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 121 inline bool setValue(const std::string& value) { return !(bHasDefaultValue_ = !convertValue<std::string , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 122 inline bool setValue(const orxonox::Vector2& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector2 , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 123 inline bool setValue(const orxonox::Vector3& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector3 , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 124 inline bool setValue(const orxonox::Vector4& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector4 , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 125 inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 126 inline bool setValue(const orxonox::Quaternion& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 127 inline bool setValue(const orxonox::Radian& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Radian , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 128 inline bool setValue(const orxonox::Degree& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::Degree , T>(&value_, value, zeroise<T>())); } ///< Assigns the value by converting it to T. 129 130 inline operator char() const { return getConvertedValue<T, char> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 131 inline operator unsigned char() const { return getConvertedValue<T, unsigned char> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 132 inline operator short() const { return getConvertedValue<T, short> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 133 inline operator unsigned short() const { return getConvertedValue<T, unsigned short> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 134 inline operator int() const { return getConvertedValue<T, int> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 135 inline operator unsigned int() const { return getConvertedValue<T, unsigned int> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 136 inline operator long() const { return getConvertedValue<T, long> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 137 inline operator unsigned long() const { return getConvertedValue<T, unsigned long> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 138 inline operator long long() const { return getConvertedValue<T, long long> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 139 inline operator unsigned long long() const { return getConvertedValue<T, unsigned long long> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 140 inline operator float() const { return getConvertedValue<T, float> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 141 inline operator double() const { return getConvertedValue<T, double> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 142 inline operator long double() const { return getConvertedValue<T, long double> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 143 inline operator bool() const { return getConvertedValue<T, bool> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 144 inline operator void*() const { return getConvertedValue<T, void*> (this->value_, 0); } ///< Returns the current value, converted to the requested type. 145 inline operator std::string() const { return getConvertedValue<T, std::string> (this->value_, NilValue<std::string >()); } ///< Returns the current value, converted to the requested type. 146 inline operator orxonox::Vector2() const { return getConvertedValue<T, orxonox::Vector2> (this->value_, NilValue<orxonox::Vector2 >()); } ///< Returns the current value, converted to the requested type. 147 inline operator orxonox::Vector3() const { return getConvertedValue<T, orxonox::Vector3> (this->value_, NilValue<orxonox::Vector3 >()); } ///< Returns the current value, converted to the requested type. 148 inline operator orxonox::Vector4() const { return getConvertedValue<T, orxonox::Vector4> (this->value_, NilValue<orxonox::Vector4 >()); } ///< Returns the current value, converted to the requested type. 149 inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, NilValue<orxonox::ColourValue>()); } ///< Returns the current value, converted to the requested type. 150 inline operator orxonox::Quaternion() const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, NilValue<orxonox::Quaternion >()); } ///< Returns the current value, converted to the requested type. 151 inline operator orxonox::Radian() const { return getConvertedValue<T, orxonox::Radian> (this->value_, NilValue<orxonox::Radian >()); } ///< Returns the current value, converted to the requested type. 152 inline operator orxonox::Degree() const { return getConvertedValue<T, orxonox::Degree> (this->value_, NilValue<orxonox::Degree >()); } ///< Returns the current value, converted to the requested type. 153 154 /// Puts the current value on the stream 151 155 inline void toString(std::ostream& outstream) const { outstream << this->value_; } 152 156 153 / ** @brief loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data */157 /// loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data 154 158 inline void importData( uint8_t*& mem ) { loadAndIncrease( /*(const T&)*/this->value_, mem ); } 155 / ** @brief saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data */159 /// saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data 156 160 inline void exportData( uint8_t*& mem ) const { saveAndIncrease( /*(const T&)*/this->value_, mem ); } 157 / ** @brief returns the size of the data that would be saved by exportData */161 /// returns the size of the data that would be saved by exportData 158 162 inline uint8_t getSize() const { return returnSize( this->value_ ); } 159 163 160 T value_; // !< The stored value164 T value_; ///< The stored value 161 165 }; 162 166
Note: See TracChangeset
for help on using the changeset viewer.