Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 1, 2007, 4:24:56 AM (16 years ago)
Author:
landauf
Message:

added comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/core/IdentifierIncludes.h

    r362 r365  
     1/**
     2    @file IDentifierIncludes.h
     3    @brief Definition of macros for the class-hierarchy and the factory.
     4
     5    Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface
     6    or the BaseObject itself, it needs the macro RegisterRootObject(class) instead.
     7
     8    To allow the object being created through the factory, use the CreateFactory(class) macro outside
     9    the of the class implementation, so it gets executed before main().
     10*/
     11
     12// All needed header-files
    113#include "Identifier.h"
    214#include "Factory.h"
     
    618
    719
     20// Intern macro, containing the common parts of RegisterObject and RegisterRootObject
    821#define InternRegisterObject(ClassName, bRootClass) \
    922    this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \
     
    1225    ClassIdentifier<ClassName>::addObject(this)
    1326
     27// Intern macro, containing the specific part of RegisterRootObject
    1428#define InternRegisterRootObject(ClassName) \
    1529    if (Identifier::isCreatingHierarchy() && !this->getParents()) \
     
    1731    InternRegisterObject(ClassName, true)
    1832
     33// RegisterObject - with and without debug output
    1934#if HIERARCHY_VERBOSE
    2035#define RegisterObject(ClassName) \
     
    2641#endif
    2742
     43// RegisterRootObject - with and without debug output
    2844#if HIERARCHY_VERBOSE
    2945#define RegisterRootObject(ClassName) \
     
    3551#endif
    3652
     53// Class(ClassName) returns the Identifier of the given class
    3754#define Class(ClassName) \
    3855    ClassIdentifier<ClassName>::getIdentifier()
    3956
     57// Creates the entry in the Factory
    4058#define CreateFactory(ClassName) \
    4159    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
    4260
    43 #define ID(NameOrID) \
    44     Factory::getIdentifier(NameOrID)
     61// ID(StringOrInt) returns the Identifier with either a given name or a given NetworkID through the factory
     62#define ID(StringOrInt) \
     63    Factory::getIdentifier(StringOrInt)
Note: See TracChangeset for help on using the changeset viewer.