Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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/libraries/core
Files:
3 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    };
Note: See TracChangeset for help on using the changeset viewer.