Addition at simple wxObject*, support into wxVariant.

This includes 2 new methods wxVariant::IsValueKindOf() and
wxVariantData::GetValueClassInfo() to allow query of the
wxRTTI data of the variant's data.

Also included is a macro analogues to dynamicCast for fetching
objects out of a wxVariant.

Documentation patches for the above.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roger Gammans
2003-06-02 21:17:28 +00:00
parent 8647bec62d
commit cf6ae2907c
4 changed files with 183 additions and 2 deletions

View File

@@ -80,12 +80,14 @@ Construction from a list of strings. This constructor
copies {\it value}, the application is still responsible for
deleting {\it value} and its contents.
%Note: this constructor is currently disabled because it causes a C++ ambiguity.
\func{}{wxVariant}{\param{void*}{ value}, \param{const wxString\& }{name = ``"}}
Construction from a void pointer.
\func{}{wxVariant}{\param{wxObject*}{ value}, \param{const wxString\& }{name = ``"}}
Construction from a wxObject pointer.
\func{}{wxVariant}{\param{wxVariantData*}{ data}, \param{const wxString\& }{name = ``"}}
Construction from user-defined data. The variant holds on to the {\it data} pointer.
@@ -176,6 +178,12 @@ If the variant is null, the value type returned is the string ``null" (not the e
Gets the void pointer value.
\membersection{wxVariant::GetWxObjectPtr}\label{wxvariantgetwxobjectptr}
\constfunc{void*}{GetWxObjectPtr}{\void}
Gets the wxObject pointer value.
\membersection{wxVariant::Insert}\label{wxvariantinsert}
\func{void}{Insert}{\param{const wxVariant\&}{ value}}
@@ -194,6 +202,12 @@ Returns true if there is no data associated with this variant, false if there is
Returns true if {\it type} matches the type of the variant, false otherwise.
\membersection{wxVariant::IsValueKindOf}\label{wxvariantisvaluekindof}
\constfunc{bool}{IsValueKindOf}{\param{const wxClassInfo* type}{ type}}
Returns true if the data is derived from the class described by {\it type}, false otherwise.
\membersection{wxVariant::MakeNull}\label{wxvariantmakenull}
\func{void}{MakeNull}{\void}
@@ -381,6 +395,13 @@ Returns true if this object is equal to {\it data}.
Returns the string type of the data.
\membersection{wxVariantData::GetValueClassInfo}\label{wxvariantdatagetvalueclassinfo}
\constfunc{wxClassInfo*}{GetValueClassInfo}{\void}
If the data is a wxObject returns a pointer to the objects wxClassInfo structure, if
the data isn't a wxObject the method returns NULL.
\membersection{wxVariantData::Read}\label{wxvariantdataread}
\func{bool}{Read}{\param{ostream\&}{ stream}}
@@ -398,4 +419,16 @@ Reads the data from {\it stream} or {\it string}.
Writes the data to {\it stream} or {\it string}.
\membersection{wxGetVariantCast}\label{wxgetvariantcast}
\func{classname *}{wxGetVariantCast}{wxVariant\&, classname}
This macro returns the data stored in {\it variant} cast to the type {\it classname *} if
the data is of this type (the check is done during the run-time) or
{\tt NULL} otherwise.
\wxheading{See also}
\helpref{RTTI overview}{runtimeclassoverview}\\
\helpref{wxDynamicCast}{wxdynamiccast}\\