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/CoreIncludes.h

    r6423 r7401  
    2828
    2929/**
     30    @defgroup Factory RegisterObject() and CreateFactory()
     31    @ingroup Object
     32*/
     33
     34/**
    3035    @file
    31     @brief Definition of macros for Identifiers
     36    @ingroup Object Factory
     37    @brief Defines several very important macros used to register objects, create factories, and to work with identifiers.
    3238
    33     Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
    34     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.
    3541
    36     To allow the object being created through the factory, use the CreateFactory(class) macro outside
    37     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
    3873*/
    3974
     
    5186
    5287/**
    53     @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.
    5489    @param ClassName The name of the class
    55     @param bRootClass True if the class is directly derived from OrxonoxClass
     90    @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass
    5691*/
    5792#define InternRegisterObject(ClassName, bRootClass) \
     
    6297
    6398/**
    64     @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.
    65100    @param ClassName The name of the class
    66101*/
     
    69104
    70105/**
    71     @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.
    72107    @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.
    73111*/
    74112#define RegisterRootObject(ClassName) \
     
    101139    /**
    102140        @brief Returns the Identifier with a given name.
    103         @param String The name of the class
     141        @param name The name of the class
    104142    */
    105143    inline Identifier* ClassByString(const std::string& name)
     
    110148    /**
    111149        @brief Returns the Identifier with a given lowercase name.
    112         @param String The lowercase name of the class
     150        @param name The lowercase name of the class
    113151    */
    114152    inline Identifier* ClassByLowercaseString(const std::string& name)
     
    119157    /**
    120158        @brief Returns the Identifier with a given network ID.
    121         @param networkID The network ID of the class
     159        @param id The network ID of the class
    122160    */
    123161    inline Identifier* ClassByID(uint32_t id)
     
    130168        @note This of course only works with OrxonoxClasses.
    131169              The only use is in conjunction with macros that don't know the class type.
    132         @param Pointer to an OrxonoxClass
     170        @param object Pointer to an OrxonoxClass
    133171    */
    134172    template <class T>
Note: See TracChangeset for help on using the changeset viewer.