Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2009, 9:22:22 PM (14 years ago)
Author:
rgrieder
Message:

Synchronised sandbox with current code trunk. There should be a few bug fixes.

Location:
sandbox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox

  • sandbox/src/libraries/core/OrxonoxClass.h

    r5738 r6038  
    7272            bool isDirectParentOf(const Identifier* identifier);
    7373
    74             template <class B> bool isA(const SubclassIdentifier<B>* identifier);
    75             template <class B> bool isExactlyA(const SubclassIdentifier<B>* identifier);
    76             template <class B> bool isChildOf(const SubclassIdentifier<B>* identifier);
    77             template <class B> bool isDirectChildOf(const SubclassIdentifier<B>* identifier);
    78             template <class B> bool isParentOf(const SubclassIdentifier<B>* identifier);
    79             template <class B> bool isDirectParentOf(const SubclassIdentifier<B>* identifier);
    80 
    81             template <class B> bool isA(const SubclassIdentifier<B> identifier);
    82             template <class B> bool isExactlyA(const SubclassIdentifier<B> identifier);
    83             template <class B> bool isChildOf(const SubclassIdentifier<B> identifier);
    84             template <class B> bool isDirectChildOf(const SubclassIdentifier<B> identifier);
    85             template <class B> bool isParentOf(const SubclassIdentifier<B> identifier);
    86             template <class B> bool isDirectParentOf(const SubclassIdentifier<B> identifier);
     74            template <class B> inline bool isA(const SubclassIdentifier<B>* identifier)
     75                { return this->isA(*identifier); }
     76            template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier)
     77                { return this->isExactlyA(*identifier); }
     78            template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier)
     79                { return this->isChildOf(*identifier); }
     80            template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier)
     81                { return this->isDirectChildOf(*identifier); }
     82            template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier)
     83                { return this->isParentOf(*identifier); }
     84            template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier)
     85                { return this->isDirectParentOf(*identifier); }
    8786
    8887            bool isA(const OrxonoxClass* object);
     
    10099                Returns NULL if the no pointer was found.
    101100            */
    102             template <class T>
    103             FORCEINLINE T* getDerivedPointer(unsigned int classID)
     101            FORCEINLINE void* getDerivedPointer(unsigned int classID)
    104102            {
    105103                for (int i = this->objectPointers_.size() - 1; i >= 0; --i)
    106104                {
    107105                    if (this->objectPointers_[i].first == classID)
    108                         return static_cast<T*>(this->objectPointers_[i].second);
     106                        return this->objectPointers_[i].second;
    109107                }
    110108                return NULL;
    111109            }
    112             //! Const version of getDerivedPointer
    113             template <class T>
    114             FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
    115             {
    116                 return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);
    117             }
     110
     111            //! Version of getDerivedPointer with template
     112            template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID)
     113            {   return static_cast<T*>(this->getDerivedPointer(classID));   }
     114            //! Const version of getDerivedPointer with template
     115            template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const
     116            {   return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID);   }
    118117
    119118        private:
Note: See TracChangeset for help on using the changeset viewer.