00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00038 template<class D, class T> class pgType
00039 {
00040 public:
00044 pgType()
00045 {
00046 m_type = 0;
00047 }
00048
00053 pgType(T type)
00054 {
00055 m_type = static_cast<D>(type);
00056 }
00057
00063 pgType<D, T>& operator=(T type)
00064 {
00065 m_type = static_cast<D>(type);
00066
00067 return *this;
00068 }
00069
00075 bool operator==(pgType<D, T> type) const
00076 {
00077 return (getType() == type.getType());
00078 }
00079
00085 bool operator==(T type) const
00086 {
00087 return (getType() == type);
00088 }
00089
00096 friend bool operator==(T type1, pgType<D, T> type2)
00097 {
00098 return (type1 == type2.getType());
00099 }
00100
00106 bool operator!=(pgType<D, T> type) const
00107 {
00108 return (getType() != type.getType());
00109 }
00110
00116 bool operator!=(T type) const
00117 {
00118 return (getType() != type);
00119 }
00120
00127 friend bool operator!=(T type1, pgType<D, T> type2)
00128 {
00129 return (type1 != type2.getType());
00130 }
00131
00136 T getType() const
00137 {
00138 return static_cast<T>(m_type);
00139 }
00140
00145 D getValue() const
00146 {
00147 return m_type;
00148 }
00149
00150 private:
00151 D m_type;
00152 };
00153
00154
00155 template<class D> class pgType<D, bool>
00156 {
00157 public:
00158 pgType()
00159 {
00160 m_type = 0;
00161 }
00162
00163 pgType(bool type)
00164 {
00165 m_type = static_cast<D>(type);
00166 }
00167
00168 pgType<D, bool>& operator=(bool type)
00169 {
00170 m_type = static_cast<D>(type);
00171
00172 return *this;
00173 }
00174
00175 bool operator==(pgType<D, bool> type) const
00176 {
00177 return (getType() == type.getType());
00178 }
00179
00180 bool operator==(bool type) const
00181 {
00182 return (getType() == type);
00183 }
00184
00185 friend bool operator==(bool type1, pgType<D, bool> type2)
00186 {
00187 return (type1 == type2.getType());
00188 }
00189
00190 bool operator!=(pgType<D, bool> type) const
00191 {
00192 return (getType() != type.getType());
00193 }
00194
00195 bool operator!=(bool type) const
00196 {
00197 return (getType() != type);
00198 }
00199
00200 friend bool operator!=(bool type1, pgType<D, bool> type2)
00201 {
00202 return (type1 != type2.getType());
00203 }
00204
00205 bool getType() const
00206 {
00207 return m_type ? true : false;
00208 }
00209
00210 D getValue() const
00211 {
00212 return m_type;
00213 }
00214
00215 private:
00216 D m_type;
00217 };