38 enum ITYPE_VERIFY_RESULT
45 Verify_Failed=0xffffffff
57 IType* GetType(
const char* szTypeName)
const;
62 bool SetType(
IType* pType);
63 static void ReleaseType(
IType* pType);
65 map<string,IType*> m_types;
78 virtual const char* GetTypeName()
const=0;
79 virtual int Verify(
const char* input)
const=0;
80 static IType* GetType(
const char* szTypeName);
81 IType* GetType()
const;
82 int GetTypeValue()
const{
return m_etype;}
84 virtual bool operator ==(
int value)
const 86 return m_etype==value;
88 virtual bool operator ==(
const char *szTypeName)
const;
89 virtual bool operator ==(
const IType& value)
const 91 return m_etype==value.m_etype;
104 static const char TypeName[];
105 CVoid(){m_etype=Type_void;}
106 virtual const char* GetTypeName()
const 110 virtual int Verify(
const char* input)
const 112 return input==NULL?Verify_Unknown:Verify_Success;
121 static const char TypeName[];
122 CBool(){m_etype=Type_Bool;}
123 virtual const char* GetTypeName()
const 127 static bool Parse(
const char* input);
128 virtual int Verify(
const char* input)
const;
136 static const char TypeName[];
137 CInt32(){m_etype=Type_Int;}
138 static const int MaxValue;
139 static const int MinValue;
140 static int Parse(
const char* input);
141 virtual const char* GetTypeName()
const 145 virtual int Verify(
const char* input)
const;
153 static const char TypeName[];
156 CFloat(){m_etype=Type_Float;}
157 virtual const char* GetTypeName()
const 161 static float Parse(
const char* input);
162 virtual int Verify(
const char* input)
const;
170 static const char TypeName[];
171 static const double MaxValue;
172 static const double MinValue;
173 CDouble(){m_etype=Type_Double;}
174 virtual const char* GetTypeName()
const 178 static double Parse(
const char* input);
179 virtual int Verify(
const char* input)
const;
187 static const char TypeName[];
188 CStr(){m_etype=Type_String;}
189 virtual const char* GetTypeName()
const 193 virtual int Verify(
const char* input)
const;
204 m_type=IType::GetType(
"int");
210 m_type=IType::GetType(
"int");
216 operator int(){
return m_data;}
217 CDataInt32& operator =(
int data){m_data=data;
return *
this;}
218 virtual bool operator ==(
int value){
return m_data==value;}
219 virtual string ToString()
const;
220 virtual const IType* GetType()
const{
return m_type;}
222 static const IType* m_type;
232 m_type=IType::GetType(
"bool");
238 m_type=IType::GetType(
"bool");
244 operator bool(){
return m_data;}
245 CDataBool& operator =(
bool data){m_data=data;
return *
this;}
246 virtual bool operator ==(
bool value)
const{
return m_data==value;}
247 virtual string ToString()
const;
248 virtual const IType* GetType()
const{
return m_type;}
250 static const IType* m_type;
260 m_type=IType::GetType(
"float");
266 m_type=IType::GetType(
"float");
272 operator float(){
return m_data;}
273 CDataFloat& operator =(
float data){m_data=data;
return *
this;}
274 virtual bool operator ==(
float value)
const{
return m_data==value;}
275 virtual string ToString()
const;
276 virtual const IType* GetType()
const{
return m_type;}
278 static const IType* m_type;
288 m_type=IType::GetType(
"double");
294 m_type=IType::GetType(
"double");
300 operator double(){
return m_data;}
301 CDataDouble& operator =(
double data){m_data=data;
return *
this;}
302 virtual bool operator ==(
double value)
const{
return m_data==value;}
303 virtual string ToString()
const;
304 virtual const IType* GetType()
const{
return m_type;}
306 static const IType* m_type;
316 m_type=IType::GetType(
"string");
322 m_type=IType::GetType(
"string");
328 operator const string()
const{
return m_data;}
329 operator const char*()
const {
return m_data.c_str();}
330 operator const wstring()
const;
331 CDataString& operator =(
const string& data){m_data=data;
return *
this;}
333 bool operator ==(
const string&
value)
const{
return m_data==value;}
334 bool operator ==(
const char* value)
const{
return m_data==value;}
337 bool operator ==(
const wstring& value)
const;
338 virtual string ToString()
const;
339 virtual const IType* GetType()
const{
return m_type;}
341 static const IType* m_type;
351 virtual bool IsContainer()
const=0;
352 virtual int Verify(
const char* input)
const{
return Verify_Success;}
359 virtual bool IsContainer()
const{
return true;}
360 static const char TypeName[];
361 virtual const char* GetTypeName()
const 373 virtual bool IsContainer()
const{
return false;}
374 static const char TypeName[];
375 virtual const char* GetTypeName()
const 387 virtual bool IsContainer()
const{
return false;}
388 static const char TypeName[];
389 virtual const char* GetTypeName()
const 401 virtual bool IsContainer()
const{
return false;}
402 static const char TypeName[];
403 virtual const char* GetTypeName()
const 415 virtual bool IsContainer()
const{
return false;}
416 static const char TypeName[];
417 virtual const char* GetTypeName()
const 429 virtual bool IsContainer()
const{
return false;}
430 static const char TypeName[];
431 virtual const char* GetTypeName()
const 443 virtual bool IsContainer()
const{
return false;}
444 static const char TypeName[];
445 virtual const char* GetTypeName()
const 457 virtual bool IsContainer()
const{
return false;}
458 static const char TypeName[];
459 virtual const char* GetTypeName()
const 471 virtual bool IsContainer()
const{
return true;}
472 static const char TypeName[];
473 virtual const char* GetTypeName()
const 485 virtual bool IsContainer()
const{
return false;}
486 static const char TypeName[];
487 virtual const char* GetTypeName()
const 499 virtual bool IsContainer()
const{
return false;}
500 static const char TypeName[];
501 virtual const char* GetTypeName()
const 513 virtual bool IsContainer()
const{
return false;}
514 static const char TypeName[];
515 virtual const char* GetTypeName()
const 527 virtual bool IsContainer()
const{
return false;}
528 static const char TypeName[];
529 virtual const char* GetTypeName()
const 541 virtual bool IsContainer()
const{
return true;}
542 static const char TypeName[];
543 virtual const char* GetTypeName()
const 554 virtual bool IsContainer()
const{
return false;}
555 static const char TypeName[];
556 virtual const char* GetTypeName()
const
void Clone(IObject *obj) const
Clone the object's contains to a pointer.
Definition: Type.h:299
IType is for type information and validating It contains type information of an object.
Definition: Type.h:75
void Clone(IObject *obj) const
Clone the object's contains to a pointer.
Definition: Type.h:327
IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: Type.h:326
different physics engine has different winding order.
Definition: EventBinding.h:32
IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: Type.h:214
void Clone(IObject *obj) const
Clone the object's contains to a pointer.
Definition: Type.h:243
void Clone(IObject *obj) const
Clone the object's contains to a pointer.
Definition: Type.h:271
base class for object, such as CBaseObject, IAttributeObject, GUI object.
Definition: PERef.h:287
Definition: enum_maker.hpp:46
void Clone(IObject *obj) const
Clone the object's contains to a pointer.
Definition: Type.h:215
IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: Type.h:298
IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: Type.h:242
IObject * Clone() const
Clone the object's contains and return a pointer to the newly created object.
Definition: Type.h:270