00001 #ifndef XDKWRL_SFFLOAT_H
00002 #define XDKWRL_SFFLOAT_H
00003
00004 #include <xdkwrl/fieldtypes.h>
00005 #include <iostream>
00006
00007 namespace wrl
00008 {
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 class SFFloat
00019 {
00020 public:
00021 inline SFFloat();
00022 inline SFFloat(const float b);
00023 inline SFFloat& operator=(const float b);
00024 inline SFFloat& operator=(const SFFloat b);
00025 inline operator float() const;
00026 inline float operator==(const SFFloat& b);
00027 static inline const char* typeName();
00028 static inline FieldTypeId typeId();
00029 friend std::ostream& operator<<(std::ostream& s,const SFFloat& f);
00030 protected:
00031 private:
00032 float value_;
00033 };
00034
00035
00036
00037
00038
00039
00040 inline
00041 SFFloat::SFFloat()
00042 : value_(0.0f)
00043 {
00044 }
00045
00046
00047
00048 inline
00049 SFFloat::SFFloat(const float b)
00050 : value_(b)
00051 {
00052 }
00053 inline SFFloat&
00054 SFFloat::operator=(const float b)
00055 {
00056 value_ = b;
00057 return *this;
00058 }
00059 inline SFFloat&
00060 SFFloat::operator=(const SFFloat b)
00061 {
00062 value_ = b.value_;
00063 return *this;
00064 }
00065 inline
00066 SFFloat::operator float() const
00067 {
00068 return value_;
00069 }
00070 inline float
00071 SFFloat::operator==(const SFFloat& b)
00072 {
00073 return value_ == b.value_;
00074 }
00075 inline const char*
00076 SFFloat::typeName()
00077 {
00078 return "SFFloat";
00079 }
00080 inline FieldTypeId
00081 SFFloat::typeId()
00082 {
00083 return sfFloat;
00084 }
00085 inline std::ostream& operator<<(std::ostream& s,const SFFloat& f)
00086 {
00087 return s<<f.value_;
00088 }
00089 };
00090
00091 #endif // XDKWRL_SFFLOAT_H