Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 7, 2010, 12:58:52 AM (14 years ago)
Author:
landauf
Message:

enhanced documentation of some core classes and added examples

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/src/libraries/core/CoreIncludes.h

    r7363 r7372  
    3737    @brief Definition of macros for Identifiers
    3838
    39     Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
    40     or the BaseObject itself, it needs the macro RegisterRootObject(class) instead.
     39    Every class needs the @c RegisterObject(class) macro in its constructor. If the class is an interface
     40    or the @c BaseObject itself, it needs the macro @c RegisterRootObject(class) instead.
    4141
    42     To allow the object being created through the factory, use the CreateFactory(class) macro outside
    43     the of the class implementation, so it gets executed before main().
     42    To allow the object being created through the factory, use the @c CreateFactory(class) macro outside
     43    of the class implementation, so it gets executed statically before @c main(). This will at the same time
     44    register @a class in the class-hierarchy. If you don't want @a class to be loadable, but still
     45    register it, call @c CreateUnloadableFactory(class).
     46
     47    Example:
     48    @code
     49    // Create the factory for MyClass
     50    CreateFactory(MyClass);
     51
     52    // Constructor:
     53    MyClass::MyClass()
     54    {
     55        // Register the object in the Identifier of MyClass
     56        RegisterObject(MyClass);
     57    }
     58    @endcode
     59
     60    This file also defines a number of other useful macros, like, for example, @c Class(class) which
     61    returns the @ref orxonox::Identifier "Identifier" of @a class, or @c ClassByString("class") which
     62    returns the Identifier of a class with name @a "class".
     63
     64    Example:
     65    @code
     66    // Assigns the Identifier of MyClass
     67    Identifier* identifier = Class(MyClass);
     68    @endcode
     69    @code
     70    // Assigns the Identifier of a class named "MyClass"
     71    Identifier* identifier = ClassByString("MyClass");
     72    @endcode
    4473*/
    4574
     
    5786
    5887/**
    59     @brief Intern macro, containing the common parts of RegisterObject and RegisterRootObject.
     88    @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject.
    6089    @param ClassName The name of the class
    61     @param bRootClass True if the class is directly derived from OrxonoxClass
     90    @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass
    6291*/
    6392#define InternRegisterObject(ClassName, bRootClass) \
     
    6897
    6998/**
    70     @brief RegisterObject - with and without debug output.
     99    @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.
    71100    @param ClassName The name of the class
    72101*/
     
    75104
    76105/**
    77     @brief RegisterRootObject - with and without debug output.
     106    @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName.
    78107    @param ClassName The name of the class
     108
     109    In contrast to RegisterObject, this is used for classes that inherit directly from
     110    orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject.
    79111*/
    80112#define RegisterRootObject(ClassName) \
Note: See TracChangeset for help on using the changeset viewer.