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

    r7163 r7401  
    2828
    2929/**
     30    @defgroup OrxonoxClass OrxonoxClass
     31    @ingroup Class
     32*/
     33
     34/**
    3035    @file
    31     @brief Declaration of the OrxonoxClass Class.
     36    @ingroup Class OrxonoxClass
     37    @brief Declaration of OrxonoxClass, the base class of all objects and interfaces in Orxonox.
    3238
    3339    All objects and interfaces of the game-logic (not the engine) are derived from OrxonoxClass.
     
    5359namespace orxonox
    5460{
    55     //! The class all objects and interfaces of the game-logic (not the engine) are derived from.
    5661    /**
    57         The BaseObject and Interfaces are derived with 'virtual public OrxonoxClass' from OrxonoxClass.
    58         OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the MetaObjectList.
     62        @brief The class all objects and interfaces of the game-logic (not the engine) are derived from.
     63
     64        The BaseObject and Interfaces are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass.
     65        OrxonoxClass is needed to create the class-hierarchy at startup and to store the Identifier and the
     66        MetaObjectList, as well as to provide an interface for SmartPtr and WeakPtr.
    5967    */
    6068    class _CoreExport OrxonoxClass
     
    7684            void unregisterObject();
    7785
    78             /** @brief Function to collect the SetConfigValue-macro calls. */
     86            /// Function to collect the SetConfigValue-macro calls.
    7987            void setConfigValues() {};
    8088
    81             /** @brief Returns the Identifier of the object. @return The Identifier */
     89            /// Returns the Identifier of the object.
    8290            inline Identifier* getIdentifier() const { return this->identifier_; }
    8391
     
    8997            bool isDirectParentOf(const Identifier* identifier);
    9098
     99            /// Returns true if the object's class is of the given type or a derivative.
    91100            template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
    92101                { return this->isA(*identifier); }
     102            /// Returns true if the object's class is exactly of the given type.
    93103            template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
    94104                { return this->isExactlyA(*identifier); }
     105            /// Returns true if the object's class is a child of the given type.
    95106            template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
    96107                { return this->isChildOf(*identifier); }
     108            /// Returns true if the object's class is a direct child of the given type.
    97109            template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
    98110                { return this->isDirectChildOf(*identifier); }
     111            /// Returns true if the object's class is a parent of the given type.
    99112            template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
    100113                { return this->isParentOf(*identifier); }
     114            /// Returns true if the object's class is a direct parent of the given type.
    101115            template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
    102116                { return this->isDirectParentOf(*identifier); }
     
    111125            virtual void clone(OrxonoxClass*& item) {}
    112126
     127            /// Returns the number of @ref orxonox::SmartPtr "smart pointers" that point to this object.
    113128            inline unsigned int getReferenceCount() const
    114129                { return this->referenceCount_; }
     
    131146            }
    132147
    133             //! Version of getDerivedPointer with template
     148            /// Version of getDerivedPointer with template
    134149            template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
    135150            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
    136             //! Const version of getDerivedPointer with template
     151            /// Const version of getDerivedPointer with template
    137152            template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
    138153            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
    139154
    140155        protected:
     156            /// This virtual function is called if destroy() is called and no SmartPtr points to this object. Used in some cases to create a new SmartPtr to prevent destruction.
    141157            virtual void preDestroy() {}
    142158
    143159        private:
    144             /** @brief Increments the reference counter (for smart pointers). */
     160            /// Increments the reference counter (for smart pointers).
    145161            inline void incrementReferenceCount()
    146162                { ++this->referenceCount_; }
    147             /** @brief Decrements the reference counter (for smart pointers). */
     163            /// Decrements the reference counter (for smart pointers).
    148164            inline void decrementReferenceCount()
    149165            {
     
    153169            }
    154170
    155             /** @brief Register a weak pointer which points to this object. */
     171            /// Register a weak pointer which points to this object.
    156172            template <class T>
    157173            inline void registerWeakPtr(WeakPtr<T>* pointer)
    158174                { this->weakPointers_.insert(reinterpret_cast<WeakPtr<OrxonoxClass>*>(pointer)); }
    159             /** @brief Unegister a weak pointer which pointed to this object before. */
     175            /// Unegister a weak pointer which pointed to this object before.
    160176            template <class T>
    161177            inline void unregisterWeakPtr(WeakPtr<T>* pointer)
    162178                { this->weakPointers_.erase(reinterpret_cast<WeakPtr<OrxonoxClass>*>(pointer)); }
    163179
    164             Identifier* identifier_;                   //!< The Identifier of the object
    165             std::set<const Identifier*>* parents_;     //!< List of all parents of the object
    166             MetaObjectList* metaList_;                 //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
    167             int referenceCount_;                       //!< Counts the references from smart pointers to this object
    168             bool requestedDestruction_;                //!< Becomes true after someone called delete on this object
    169             std::set<WeakPtr<OrxonoxClass>*> weakPointers_; //!< All weak pointers which point to this object (and like to get notified if it dies)
     180            Identifier* identifier_;                            //!< The Identifier of the object
     181            std::set<const Identifier*>* parents_;              //!< List of all parents of the object
     182            MetaObjectList* metaList_;                          //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
     183            int referenceCount_;                                //!< Counts the references from smart pointers to this object
     184            bool requestedDestruction_;                         //!< Becomes true after someone called delete on this object
     185            std::set<WeakPtr<OrxonoxClass>*> weakPointers_;     //!< All weak pointers which point to this object (and like to get notified if it dies)
    170186
    171             //! 'Fast map' that holds this-pointers of all derived types
     187            /// 'Fast map' that holds this-pointers of all derived types
    172188            std::vector<std::pair<unsigned int, void*> > objectPointers_;
    173189    };
Note: See TracChangeset for help on using the changeset viewer.