X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..8b385bf892c1f831965313eaf3ee59b10b435afd:/interface/wx/defs.h?ds=sidebyside diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 61b05d3599..cdfa5d7ac5 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: defs.h +// Name: wx/defs.h // Purpose: interface of global functions // Author: wxWidgets team // RCS-ID: $Id$ @@ -8,7 +8,7 @@ /** Item kinds for use with wxMenu, wxMenuItem, and wxToolBar. - + @see wxMenu::Append(), wxMenuItem::wxMenuItem(), wxToolBar::AddTool() */ enum wxItemKind @@ -244,6 +244,64 @@ enum wxPaperSize /** @ingroup group_funcmacro_misc */ //@{ +/** + This macro can be used in a class declaration to disable the generation of + default assignment operator. + + Some classes have a well-defined copy constructor but cannot have an + assignment operator, typically because they can't be modified once created. + In such case, this macro can be used to disable the automatic assignment + operator generation. + + @see DECLARE_NO_COPY_CLASS() + */ +#define DECLARE_NO_ASSIGN_CLASS(classname) + +/** + This macro can be used in a class declaration to disable the generation of + default copy ctor and assignment operator. + + Some classes don't have a well-defined copying semantics. In this case the + standard C++ convention is to not allow copying them. One way of achieving + it is to use this macro which simply defines a private copy constructor and + assignment operator. + + Beware that simply not defining copy constructor and assignment operator is + @em not enough as the compiler would provide its own automatically-generated + versions of them -- hence the usefulness of this macro. + + Example of use: + @code + class FooWidget + { + public: + FooWidget(); + ... + + private: + // widgets can't be copied + DECLARE_NO_COPY_CLASS(FooWidget) + }; + @endcode + + Notice that a semicolon should not be used after this macro and that it + changes the access specifier to private internally so it is better to use + it at the end of the class declaration. + */ +#define DECLARE_NO_COPY_CLASS(classname) + +/** + Equivalent of DECLARE_NO_COPY_CLASS() for template classes. + + This macro can be used for template classes (with a single template + parameter) for the same purpose as DECLARE_NO_COPY_CLASS() is used with the + non-template classes. + + @param classname The name of the template class. + @param arg The name of the template parameter. + */ +#define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) + /** This macro can be used around a function declaration to generate warnings indicating that this function is deprecated (i.e. obsolete and planned to