00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _ivariant_h
00018 #define _ivariant_h
00019
00020 #include <spl/types.h>
00021 #include <spl/Debug.h>
00022 #include <spl/Compare.h>
00023 #include <spl/DateTime.h>
00024 #include <spl/Decimal.h>
00025 #include <spl/Exception.h>
00026 #include <spl/math/Math.h>
00027 #include <spl/Memory.h>
00028 #include <spl/RefCountPtr.h>
00029 #include <spl/String.h>
00030
00040 class IVariant : public IConvertable
00041 {
00042 public:
00043 IVariant();
00044 ~IVariant();
00045
00046 virtual bool ToBool() const = 0;
00047 virtual byte ToByte() const = 0;
00048 virtual int16 ToInt16() const = 0;
00049 virtual int32 ToInt32() const = 0;
00050 virtual int64 ToInt64() const = 0;
00051 virtual float32 ToFloat32() const = 0;
00052 virtual float64 ToFloat64() const = 0;
00053 virtual DateTime ToDateTime() const = 0;
00054 virtual Date ToDate() const = 0;
00055 virtual Decimal ToDecimal() const = 0;
00056 virtual StringPtr ToString() const = 0;
00057
00058 virtual bool ToChar(char& c2) const = 0;
00059 virtual bool ToBool(bool& c2) const = 0;
00060 virtual bool ToByte(byte& c2) const = 0;
00061 virtual bool ToInt16(int16& c2) const = 0;
00062 virtual bool ToInt32(int32& c2) const = 0;
00063 virtual bool ToInt64(int64& c2) const = 0;
00064 virtual bool ToUInt32(uint32& c2) const = 0;
00065 virtual bool ToUInt64(uint64& c2) const = 0;
00066
00067 virtual bool ToFloat32(float32& c2) const = 0;
00068 virtual bool ToFloat64(float64& c2) const = 0;
00069 virtual bool ToDateTime(DateTime& c2) const = 0;
00070 virtual bool ToDate(Date& c2) const = 0;
00071 virtual bool ToDecimal(Decimal& c2) const = 0;
00072 virtual bool ToString(String& c2) const = 0;
00073
00074 virtual bool Equals( const IComparable& a ) const = 0;
00075 virtual int Compare( const IComparable& a ) const = 0;
00076 virtual int32 MajicNumber() const = 0;
00077 virtual int32 HashCode() const = 0;
00078
00079 virtual bool IsObject() const = 0;
00080
00081 virtual String TypeName() const = 0;
00082
00083 #ifdef DEBUG
00084 virtual void ValidateMem() const = 0;
00085 virtual void CheckMem() const = 0;
00086 #endif
00087 };
00088
00091 #endif