Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9571


Ignore:
Timestamp:
Mar 24, 2013, 9:03:22 PM (12 years ago)
Author:
landauf
Message:

using Destroyable instead of OrxonoxClass now wherever the destruction-related members are addressed

Location:
code/branches/core6/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/core/command/Functor.h

    r9563 r9571  
    120120#include "util/Output.h"
    121121#include "util/MultiType.h"
    122 #include "core/class/OrxonoxClass.h"
     122#include "core/object/Destroyable.h"
    123123#include "FunctorPtr.h"
    124124
     
    303303            /// Casts the object and registers as destruction listener.
    304304            inline void registerObject(O* object)
    305                 { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->registerAsDestructionListener(base); } }
     305                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->registerAsDestructionListener(base); } }
    306306            /// Casts the object and unregisters as destruction listener.
    307307            inline void unregisterObject(O* object)
    308                 { OrxonoxClass* base = dynamic_cast<OrxonoxClass*>(object); if (base) { this->unregisterAsDestructionListener(base); } }
    309 
    310             /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted and the Functor is in safe mode.
     308                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->unregisterAsDestructionListener(base); } }
     309
     310            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode.
    311311            inline void objectDeleted()
    312312                { this->object_ = 0; }
  • code/branches/core6/src/libraries/core/object/SmartPtr.h

    r9563 r9571  
    4444    object  and keeps this object alive until no SmartPtr points to this object anymore.
    4545    In contrast to orxonox::SharedPtr, SmartPtr works only with classes that are derived
    46     from orxonox::OrxonoxClass, because it's an intrusive implementation, meaning the
     46    from orxonox::Destroyable, because it's an intrusive implementation, meaning the
    4747    reference counter is stored in the object itself.
    4848
     
    7878    };
    7979    @endcode
    80     In this example we assume that OtherClass is a child of OrxonoxClass. We don't care
     80    In this example we assume that OtherClass is a child of Destroyable. We don't care
    8181    about the inheritance of MyClass though.
    8282
     
    123123#include <cassert>
    124124
    125 #include "core/class/OrxonoxClass.h"
     125#include "core/object/Destroyable.h"
    126126#include "WeakPtr.h"
    127127
     
    227227            }
    228228
    229             /// Returns the wrapped pointer as @c OrxonoxClass*
    230             inline OrxonoxClass* getBase() const
     229            /// Returns the wrapped pointer as @c Destroyable*
     230            inline Destroyable* getBase() const
    231231            {
    232232                return this->base_;
     
    268268                }
    269269                {
    270                     OrxonoxClass* temp = this->base_;
     270                    Destroyable* temp = this->base_;
    271271                    this->base_ = other.base_;
    272272                    other.base_ = temp;
     
    282282        private:
    283283            T* pointer_;            ///< The wrapped pointer to an object of type @a T
    284             OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)
     284            Destroyable* base_;    ///< The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)
    285285    };
    286286
  • code/branches/core6/src/libraries/core/object/WeakPtr.h

    r9563 r9571  
    4040    destroyed.
    4141
    42     WeakPtr works only with objects that are derived from orxonox::OrxonoxClass, because
     42    WeakPtr works only with objects that are derived from orxonox::Destroyable, because
    4343    WeakPtr is intrusive and registers itself in the stored object, to get a notification if
    4444    the object is being deleted.
     
    5858        pointer->someFunction();                        // this will not be executed
    5959    @endcode
    60     In this example we assumed that MyClass is derived of OrxonoxClass (otherwise it couldn't
     60    In this example we assumed that MyClass is derived of Destroyable (otherwise it couldn't
    6161    be used with a WeakPtr).
    6262
     
    8585#include <cassert>
    8686
    87 #include "core/class/OrxonoxClass.h"
     87#include "core/object/Destroyable.h"
    8888#include "core/command/Functor.h"
    8989
     
    169169            }
    170170
    171             /// Returns the wrapped pointer as @c OrxonoxClass*
    172             inline OrxonoxClass* getBase() const
     171            /// Returns the wrapped pointer as @c Destroyable*
     172            inline Destroyable* getBase() const
    173173            {
    174174                return this->base_;
     
    213213                }
    214214                {
    215                     OrxonoxClass* temp = this->base_;
     215                    Destroyable* temp = this->base_;
    216216                    this->base_ = other.base_;
    217217                    other.base_ = temp;
     
    241241
    242242        private:
    243             /// Will be called by OrxonoxClass::~OrxonoxClass() if the stored object is deleted. Resets the wrapped pointer and executes the callback.
     243            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted. Resets the wrapped pointer and executes the callback.
    244244            inline void objectDeleted()
    245245            {
     
    251251
    252252            T* pointer_;            ///< The wrapped pointer to an object of type @a T
    253             OrxonoxClass* base_;    ///< The wrapped pointer, casted up to OrxonoxClass (this is needed because with just a T* pointer, WeakPtr couln't be used with forward declarations)
     253            Destroyable* base_;    ///< The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, WeakPtr couln't be used with forward declarations)
    254254            FunctorPtr callback_;   ///< This callback will be executed if the stored object is deleted
    255255    };
  • code/branches/core6/src/libraries/util/ScopedSingletonManager.h

    r8858 r9571  
    6868namespace orxonox
    6969{
    70     class OrxonoxClass;
     70    class Destroyable;
    7171
    7272    /**
     
    166166        }
    167167
    168         //! Destroys the singleton instance - overloaded for OrxonoxClass, calls OrxonoxClass::destroy()
    169         void destroy(OrxonoxClass*)
     168        //! Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy()
     169        void destroy(Destroyable*)
    170170        {
    171171            singletonPtr_->destroy();
     
    246246        }
    247247
    248         //! Destroys the singleton instance - overloaded for OrxonoxClass, calls OrxonoxClass::destroy()
    249         void destroy(OrxonoxClass*)
     248        //! Destroys the singleton instance - overloaded for Destroyable, calls Destroyable::destroy()
     249        void destroy(Destroyable*)
    250250        {
    251251            singletonPtr_->destroy();
  • code/branches/core6/src/orxonox/interfaces/Pickupable.cc

    r9563 r9571  
    7171    /**
    7272    @brief
    73         A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
     73        A method that is called by Destroyable::destroy() before the object is actually destroyed.
    7474    */
    7575    void Pickupable::preDestroy(void)
     
    9898    {
    9999        if(!this->isBeingDestroyed())
    100             this->OrxonoxClass::destroy();
     100            this->Destroyable::destroy();
    101101        else
    102102            orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl;
  • code/branches/core6/src/orxonox/interfaces/Pickupable.h

    r9563 r9571  
    144144
    145145        protected:
    146             virtual void preDestroy(void); //!< A method that is called by OrxonoxClass::destroy() before the object is actually destroyed.
     146            virtual void preDestroy(void); //!< A method that is called by Destroyable::destroy() before the object is actually destroyed.
    147147            virtual void destroyPickup(void); //!< Destroys a Pickupable.
    148148            virtual void carrierDestroyed(void); //!< Is called by the PickupCarrier when it is being destroyed.
Note: See TracChangeset for help on using the changeset viewer.