Home | Hierarchy | Members | Alphabetical | Related Pages |
00001 #ifndef XDKWRL_SFINT32_H 00002 #define XDKWRL_SFINT32_H 00003 00004 #include <xdkwrl/fieldtypes.h> 00005 #include <iostream> 00006 00007 namespace wrl 00008 { 00009 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00010 // Interface of SFInt32 00011 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 /*! \ingroup fieldtypes 00013 * 00014 * Represents an integer value. Below is included the documentation for 00015 * this field type from the ISO standard. 00016 * \htmlinclude sfint32.html 00017 */ 00018 class SFInt32 00019 { 00020 public: 00021 inline SFInt32(); 00022 inline SFInt32(const int b); 00023 inline SFInt32& operator=(const int b); 00024 inline SFInt32& operator=(const SFInt32 b); 00025 inline operator int() const; 00026 inline int operator==(const SFInt32& b); 00027 static inline const char* typeName(); 00028 static inline FieldTypeId typeId(); 00029 friend std::ostream& operator<<(std::ostream& s,const SFInt32& f); 00030 protected: 00031 private: 00032 int value_; 00033 }; 00034 //************************************************************ 00035 // Implementation of SFInt32 00036 //************************************************************ 00037 /*! 00038 * Creates a SFInt32 with default value 0.0f. 00039 */ 00040 inline 00041 SFInt32::SFInt32() 00042 : value_(0) 00043 { 00044 } 00045 /*! 00046 * Creates a SFInt32 with value \p b. 00047 */ 00048 inline 00049 SFInt32::SFInt32(const int b) 00050 : value_(b) 00051 { 00052 } 00053 inline SFInt32& 00054 SFInt32::operator=(const int b) 00055 { 00056 value_ = b; 00057 return *this; 00058 } 00059 inline SFInt32& 00060 SFInt32::operator=(const SFInt32 b) 00061 { 00062 value_ = b.value_; 00063 return *this; 00064 } 00065 inline 00066 SFInt32::operator int() const 00067 { 00068 return value_; 00069 } 00070 inline int 00071 SFInt32::operator==(const SFInt32& b) 00072 { 00073 return value_ == b.value_; 00074 } 00075 inline const char* 00076 SFInt32::typeName() 00077 { 00078 return "SFInt32"; 00079 } 00080 inline FieldTypeId 00081 SFInt32::typeId() 00082 { 00083 return sfInt32; 00084 } 00085 inline std::ostream& operator<<(std::ostream& s,const SFInt32& f) 00086 { 00087 return s<<f.value_; 00088 } 00089 }; 00090 00091 #endif // XDKWRL_SFINT32_H
Generated on 28 Jun 2006 with
![]() |
|