X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2cd3cc948ea512eba91032323fe32207ac74bf8e..ccef4c3ad16fe5bf4365569c431f1208d79eb0ef:/docs/doxygen/overviews/runtimeclass.h?ds=inline diff --git a/docs/doxygen/overviews/runtimeclass.h b/docs/doxygen/overviews/runtimeclass.h index 39ee9cfdf4..9050ac9b6e 100644 --- a/docs/doxygen/overviews/runtimeclass.h +++ b/docs/doxygen/overviews/runtimeclass.h @@ -2,30 +2,16 @@ // Name: runtimeclass.h // Purpose: topic overview // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -/*! +/** -@page overview_runtimeclass Runtime Class Information (RTTI) +@page overview_rtti Runtime Type Information (RTTI) -@li @ref overview_runtimeclass_intro -@li @ref overview_runtimeclass_classinfo -@li @ref overview_runtimeclass_example +@tableofcontents -@seealso - -@li wxObject -@li wxClassInfo - - -
- - -@section overview_runtimeclass_intro Introduction - -One of the failings of C++ used to be that no run-time information was provided +One of the failings of C++ used to be that no runtime information was provided about a class and its position in the inheritance hierarchy. Another, which still persists, is that instances of a class cannot be created just by knowing the name of a class, which makes facilities such as persistent storage hard to @@ -35,7 +21,7 @@ Most C++ GUI frameworks overcome these limitations by means of a set of macros and functions and wxWidgets is no exception. As it originated before the addition of RTTI to the C++ standard and as support for it is still missing from some (albeit old) compilers, wxWidgets doesn't (yet) use it, but provides -it's own macro-based RTTI system. +its own macro-based RTTI system. In the future, the standard C++ RTTI will be used though and you're encouraged to use whenever possible the wxDynamicCast macro which, for the implementations @@ -72,14 +58,16 @@ The function wxCreateDynamicObject can be used to construct a new object of a given type, by supplying a string name. If you have a pointer to the wxClassInfo object instead, then you can simply call wxClassInfo::CreateObject. +@see wxObject + -@section overview_runtimeclass_classinfo wxClassInfo +@section overview_rtti_classinfo wxClassInfo This class stores meta-information about classes. An application may use macros -such as DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS to record run-time +such as DECLARE_DYNAMIC_CLASS and IMPLEMENT_DYNAMIC_CLASS to record runtime information about a class, including: -@li It's position in the inheritance hierarchy. +@li Its position in the inheritance hierarchy. @li The base class name(s) (up to two base classes are permitted). @li A string representation of the class name. @li A function that can be called to construct an instance of this class. @@ -93,13 +81,8 @@ You can get the wxClassInfo for a class by using the CLASSINFO macro, e.g. CLASSINFO(wxFrame). You can get the wxClassInfo for an object using wxObject::GetClassInfo. -@seealso - -@li wxObject -@li wxCreateDynamicObject - -@section overview_runtimeclass_example Example +@section overview_rtti_example Example In a header file frame.h: @@ -128,4 +111,3 @@ wxFrame::wxFrame() @endcode */ -