00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _VM_VARTYPE_H_
00018 #define _VM_VARTYPE_H_ 1
00019
00027 #include <vm/vmconfig.h>
00028 #include <lib/tl/tlstring.h>
00029
00030
00031 namespace VM
00032 {
00033
00046 struct _packed_ VarType
00047 {
00048 enum ID
00049 {
00050 Unknown=0,
00051 Byte,
00052 Short,
00053 Int,
00054 Long,
00055 Flt,
00056 Dbl,
00057 Ptr,
00058 };
00059
00060 ID id : 8;
00061 uint8 array;
00062
00064 inline VarType() : id(Unknown),array(0) {}
00066 inline VarType(ID _id,uint8 _array) : id(_id),array(_array) {}
00068 inline VarType(const VarType &vt) : id(vt.id),array(vt.array) {}
00070 inline ~VarType() {}
00071
00073 inline VarType &operator=(const VarType &vt)
00074 { id=vt.id; array=vt.array; return(*this); }
00075
00077 inline bool operator==(const VarType &vt) const
00078 { return(id==vt.id && array==vt.array); }
00080 inline bool operator!=(const VarType &vt) const
00081 { return(id!=vt.id || array!=vt.array); }
00082
00084 inline bool IsPointerType() const
00085 { return(array || id==Ptr); }
00086
00088 TLString TypeString() const;
00089 };
00090
00091 }
00092
00093 #endif