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
00011
00012
00013
00014
00015
00016
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
00036
00037
00038
00039
00040 inline
00041 SFBool::SFBool()
00042 : value_(false)
00043 {
00044 }
00045
00046
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