Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 26, 2009, 2:05:30 AM (15 years ago)
Author:
landauf
Message:

Added destroy() function to OrxonoxClass.
Removed destroy() functions from some subclasses.
Expanded Timer to accept Functors of other classes too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/OrxonoxClass.h

    r5772 r5791  
    5959            virtual ~OrxonoxClass();
    6060
     61            void destroy();
     62
    6163            /** @brief Function to collect the SetConfigValue-macro calls. */
    6264            void setConfigValues() {};
     
    9294            bool isDirectParentOf(const OrxonoxClass* object);
    9395
     96            inline unsigned int getReferenceCount() const
     97                { return this->referenceCount_; }
     98
    9499            /**
    95100            @brief
     
    117122
    118123        private:
     124            /** @brief Increments the reference counter (for smart pointers). */
     125            inline void incrementReferenceCount()
     126                { ++this->referenceCount_; }
     127            /** @brief Decrements the reference counter (for smart pointers). */
     128            inline void decrementReferenceCount()
     129                { --this->referenceCount_; if (this->referenceCount_ == 0 && this->requestedDestruction_) { delete this; } }
     130
    119131            Identifier* identifier_;                   //!< The Identifier of the object
    120132            std::set<const Identifier*>* parents_;     //!< List of all parents of the object
    121133            MetaObjectList* metaList_;                 //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
     134            unsigned int referenceCount_;              //!< Counts the references from smart pointers to this object
     135            bool requestedDestruction_;                //!< Becomes true after someone called delete on this object
     136
    122137            //! 'Fast map' that holds this-pointers of all derived types
    123138            std::vector<std::pair<unsigned int, void*> > objectPointers_;
Note: See TracChangeset for help on using the changeset viewer.