Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9678 in orxonox.OLD for trunk/src/lib/lang/new_class_id.h


Ignore:
Timestamp:
Aug 21, 2006, 11:59:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: implemented isA leafID and listInheritance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/new_class_id.h

    r9673 r9678  
    2424
    2525
     26  int leafClassID() const { return _classes.front()._objectList->id(); }
     27
    2628  template<class T> void registerObject(T* object, NewObjectList<T>& list);
    2729  bool isA(const NewObjectListBase& objectList) const;
    28   bool isA(int id) const;
     30  bool isA(int classID) const;
    2931  bool isA(const std::string& className) const;
    3032
     33  void listInheritance() const;
     34
    3135private:
    32 
    3336  //////////////////////////////
    3437  //// Type Definition Part ////
    3538  //////////////////////////////
    3639  //! A ClassEntry so we can store Classes inside of Objects
    37   struct ClassEntry{
     40  struct ClassEntry
     41  {
    3842    /** Simple Constuctor @param objectList the NewObjectList, @param iterator the (intrusive) Iterator inside of the ObjectList */
    3943    inline ClassEntry (NewObjectListBase* objectList, NewObjectListBase::IteratorBase* iterator) : _objectList(objectList), _iterator(iterator) {}
     
    4246  };
    4347  typedef std::list<ClassEntry>        ClassList;   //!< Type definition for the List.
     48
    4449  ClassList                           _classes;     //!< All Classes this object is part of.
    4550};
     
    5661 */
    5762template<class T>
    58     inline void NewClassID::registerObject(T* object, NewObjectList<T>& objectList)
     63inline void NewClassID::registerObject(T* object, NewObjectList<T>& objectList)
    5964{
    60   this->_classes.push_back(ClassEntry(&objectList, objectList.registerObject(object)));
     65  this->_classes.push_front(ClassEntry(&objectList, objectList.registerObject(object)));
    6166}
    6267
Note: See TracChangeset for help on using the changeset viewer.