X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/109e2ca4349381ca7ed73f78795f1779c33143e5..a8bda512079352ba81933e278d9ccdb8ef7a9866:/interface/wx/any.h diff --git a/interface/wx/any.h b/interface/wx/any.h index b7e1fe0725..de177e1430 100644 --- a/interface/wx/any.h +++ b/interface/wx/any.h @@ -3,7 +3,7 @@ // Purpose: interface of wxAny // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -45,27 +45,8 @@ When compared to wxVariant, there are various internal implementation differences as well. For instance, wxAny only allocates separate data - object in heap for large (i.e. size in bytes more than - WX_ANY_VALUE_BUFFER_SIZE) or non-POD (Plain Old Data) data types. - Pointers, integers, bools etc. are fitted in the wxAny's internal buffer - without need for any extra allocation. It is possible that wxAny cannot - automatically determine if your own data structure is considered a - POD or not, so you may need to declare it as such explicitly, using - code like this: - - @code - #include "wx/meta/pod.h" - WX_DECLARE_TYPE_POD(MyPodStruct) - @endcode - - Be extra careful what you declare as Plain Old Data. It must be such data - that can be copied with memcpy() without corrupting program integrity. For - instance, POD structures usually cannot contain pointers or references to - other data. wxRect, wxPoint, and wxSize are good examples of POD - classes. - - Note that pointers to any and all types are already automatically - declared as Plain Old Data. + object in heap for large objects (i.e. ones with size more than + WX_ANY_VALUE_BUFFER_SIZE, which at the time of writing is 16 bytes). @library{wxbase} @category{data} @@ -159,14 +140,21 @@ public: Returns the value type as wxAnyValueType instance. @remarks You cannot reliably test whether two wxAnys are of - same value type by simply comparing return values - of wxAny::GetType(). Instead use - wxAnyValueType::CheckType() template function. + same value type by simply comparing return values + of wxAny::GetType(). Instead, use wxAny::HasSameType(). + + @see HasSameType() */ const wxAnyValueType* GetType() const; /** - Tests if wxAny is null (that is, whether there is data). + Returns @true if this and another wxAny have the same + value type. + */ + bool HasSameType(const wxAny& other) const; + + /** + Tests if wxAny is null (that is, whether there is no data). */ bool IsNull() const;