Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 11, 2010, 12:34:00 AM (14 years ago)
Author:
landauf
Message:

merged doc branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/Super.h

    r7163 r7401  
    2828
    2929/**
     30    @defgroup Super Super
     31    @ingroup Class
     32*/
     33
     34/**
    3035    @file
    31     @brief Definition of all super-function related macros.
    32 
    33     This file defines all macros needed to add a new "super-function".
    34     If you add a super-function, you can call SUPER(myclass, functionname) inside your
    35     code and the function of the parentclass gets called. This is comparable with
    36     super.functionname() in Java or other languages.
    37 
    38     This works only with virtual functions that return nothing (void) and belong to
    39     classes that have an Identifier. Arguments however are supported.
    40 
    41     To add a new super-function, you have process 4 steps:
    42 
    43     1) Add a new SUPER macro
    44        This allows you to call the super-function in your code.
    45        Location: This file (Super.h), marked with --> HERE <-- comments (1/3)
    46 
    47     2) Call the SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2 macros.
    48        This defines some global classes and templates, needed to create and call the super-functions.
    49        Location: This file (Super.h), marked with --> HERE <-- comments (2/3)
    50 
    51     3) Call the SUPER_INTRUSIVE_DECLARATION macro.
    52        This will be included into the declaration of ClassIdentifier<T>.
    53        Location: This file (Super.h), marked with --> HERE <-- comments (3/3)
    54 
    55     4) Call the SUPER_FUNCTION macro.
     36    @ingroup Class Super
     37    @brief Definition of all super-function related macros, used to call functions of the base class.
     38
     39    This file defines all macros needed to add a new "super-function". If you add
     40    a super-function, you can call <tt>SUPER(myclass, functionname, arguments)</tt>
     41    inside your code and the function of the parent-class gets called. This is comparable
     42    to <tt>super.functionname(arguments)</tt> in Java or other languages.
     43
     44    This works only with virtual functions that return nothing (@c void) and belong to
     45    classes that have an @ref orxonox::Identifier "Identifier". Arguments however are
     46    supported, there's no limitation for their number and type, except that the type has
     47    to be known in Super.h.
     48
     49    To add a new super-function, you have to process 4 steps:
     50
     51    -# Add a new @c SUPER macro <br />
     52       This allows you to call the super-function in your code. <br />
     53       Location: This file (Super.h), marked with "--> HERE <--" comments (1/3)
     54    -# Call the @c SUPER_FUNCTION_GLOBAL_DECLARATION_PART1/2 macros. <br />
     55       This defines some global classes and templates, needed to create and call the super-functions. <br />
     56       Location: This file (Super.h), marked with "--> HERE <--" comments (2/3)
     57    -# Call the @c SUPER_INTRUSIVE_DECLARATION macro. <br />
     58       This will be included into the declaration of @c ClassIdentifier<T>. <br />
     59       Location: This file (Super.h), marked with "--> HERE <--" comments (3/3)
     60    -# Call the @c SUPER_FUNCTION macro. <br />
    5661       This defines a partially specialized template that will decide if a class is "super" to another class.
    57        If the check returns true, a SuperFunctionCaller gets created, which will be used by the SUPER macro.
     62       If the check returns true, a @c SuperFunctionCaller gets created, which will be used by the @c SUPER macro.
    5863       You have to add this into the header-file of the baseclass of the super-function (the class that first
    5964       implements the function), below the class declaration. You can't call it directly in this file, because
    60        otherwise you had to include the headerfile right here, which would cause some ugly backdependencies,
    61        include loops and slower compilation.
    62        Dont forget to include Super.h in the header-file.
     65       otherwise you had to include the headerfile right here, which would cause some ugly back-dependencies,
     66       include loops and slower compilation. <br />
     67       Dont forget to include Super.h in the header-file. <br />
    6368       Location: The header-file of the baseclass (Baseclass.h), below the class declaration
    6469*/
     
    205210    */
    206211
    207     // SUPER-macro: Calls Parent::functionname() where Parent is the direct parent of classname
     212    /// SUPER-macro: Calls Parent::functionname(...) where Parent is the direct parent of @a classname
    208213    #ifdef ORXONOX_COMPILER_MSVC
    209214        #define SUPER(classname, functionname, ...) \
Note: See TracChangeset for help on using the changeset viewer.