- variant.
- Actual values for user-defined types will need to be accessed via the
- wxVariantData
- object, unlike the case for basic data types where convenience functions such as
- wxVariant::GetLong can be used.
-
- Pointers to any wxObject derived class can also easily be stored
- in a wxVariant. wxVariant will then use wxWidgets' built-in RTTI system to set
- the
- type name (returned by wxVariant::GetType) and to perform
- type-safety checks at runtime.
-
- This class is useful for reducing the programming for certain tasks, such as an
- editor
- for different data types, or a remote procedure call protocol.
-
- An optional name member is associated with a wxVariant. This might be used, for
- example,
- in CORBA or OLE automation classes, where named parameters are required.
-
- Note that as of wxWidgets 2.7.1, wxVariant is @ref overview_trefcount
- "reference counted".
- Additionally, the convenience macros @b DECLARE_VARIANT_OBJECT and
- @b IMPLEMENT_VARIANT_OBJECT were added so that adding (limited) support
- for conversion to and from wxVariant can be very easily implemented without
- modifying
- either wxVariant or the class to be stored by wxVariant. Since assignment
- operators
- cannot be declared outside the class, the shift left operators are used like
- this:
+ variant. Actual values for user-defined types will need to be accessed via
+ the wxVariantData object, unlike the case for basic data types where
+ convenience functions such as GetLong() can be used.
+
+ Pointers to any wxObject derived class can also easily be stored in a
+ wxVariant. wxVariant will then use wxWidgets' built-in RTTI system to set
+ the type name (returned by GetType()) and to perform type-safety checks at
+ runtime.
+
+ This class is useful for reducing the programming for certain tasks, such
+ as an editor for different data types, or a remote procedure call protocol.
+
+ An optional name member is associated with a wxVariant. This might be used,
+ for example, in CORBA or OLE automation classes, where named parameters are
+ required.
+
+ Note that as of wxWidgets 2.7.1, wxVariant is
+ @ref overview_refcount "reference counted". Additionally, the convenience
+ macros DECLARE_VARIANT_OBJECT() and IMPLEMENT_VARIANT_OBJECT() were added
+ so that adding (limited) support for conversion to and from wxVariant can
+ be very easily implemented without modifying either wxVariant or the class
+ to be stored by wxVariant. Since assignment operators cannot be declared
+ outside the class, the shift left operators are used like this: