XTI updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-01-07 17:22:59 +00:00
parent e4e265ebf6
commit cbca59a8fb
6 changed files with 221 additions and 339 deletions

View File

@@ -113,6 +113,10 @@ public:
// FIXME-VC6: remove this hack when VC6 is no longer supported
template <typename T>
bool CheckType(T* reserved = NULL) const;
#if wxUSE_EXTENDED_RTTI
virtual const wxTypeInfo* GetTypeInfo() const = 0;
#endif
private:
};
@@ -314,6 +318,12 @@ public:
{
return Ops::GetValue(buf);
}
#if wxUSE_EXTENDED_RTTI
virtual const wxTypeInfo* GetTypeInfo() const
{
return wxGetTypeInfo((T*)NULL);
}
#endif
};
@@ -348,7 +358,7 @@ wxAnyValueTypeScopedPtr wxAnyValueTypeImpl<T>::sm_instance = new wxAnyValueTypeI
// Helper macro for using same base value type implementation for multiple
// actual C++ data types.
//
#define WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \
#define _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \
template<> \
class wxAnyValueTypeImpl<T> : public wxAnyValueTypeImpl##CLSTYPE \
{ \
@@ -369,9 +379,21 @@ public: \
const UseDataType* sptr = \
reinterpret_cast<const UseDataType*>(voidPtr); \
return static_cast<T>(*sptr); \
}
#if wxUSE_EXTENDED_RTTI
#define WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \
_WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
virtual const wxTypeInfo* GetTypeInfo() const \
{ \
return wxGetTypeInfo((T*)NULL); \
} \
};
#else
#define WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \
_WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\
};
#endif
//
// Integer value types
@@ -967,6 +989,12 @@ public:
return value;
}
#if wxUSE_EXTENDED_RTTI
const wxTypeInfo* GetTypeInfo() const
{
return m_type->GetTypeInfo();
}
#endif
/**
Template function that retrieves and converts the value of this
variant to the type that T* value is.