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