Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9692 in orxonox.OLD for branches/new_class_id/src/lib/lang


Ignore:
Timestamp:
Aug 23, 2006, 12:43:25 AM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: some thoughts on a BaseIterator class, that can travers through ObejectLists without knowing the Polymorph type.
This is all virtual, and since templated virutal functions are not allowed, quite hard to implements…
hpe it will work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/lang/new_object_list.h

    r9691 r9692  
    3636    NewObjectListDefinitionID(ClassName, -1)
    3737
    38 
     38class BaseObject;
    3939//! The superclass that all NewObjectLists follow.
    4040/**
     
    4444{
    4545public:
    46   //! An iterator Base-Class, for iterator-casting and storing.
     46  class base_iterator
     47  {
     48  public:
     49    virtual base_iterator operator++() = 0;
     50    virtual base_iterator operator--() = 0;
     51    virtual BaseObject* operator*() = 0;
     52    virtual base_iterator& operator=(const base_iterator& iterator) = 0;
     53    virtual bool operator==(const base_iterator& iterator) = 0;
     54  protected:
     55    void* _it;
     56  };
     57
     58  virtual base_iterator& base_begin() = 0;
     59  virtual base_iterator& base_end() = 0;
     60
     61  //! A fast iterator Base-Class, for iterator-casting and storing.
     62  /**
     63   * @note This Iterator is explicitely used only for storage purposes
     64   */
    4765  class IteratorBase { };
    4866
     
    7694
    7795protected:
    78   typedef std::map<int, NewObjectListBase*> classIDMap;    //!< The Generic Map.
    79   typedef std::map<std::string, NewObjectListBase*> classNameMap;//!< The Generic Map.
     96  typedef std::map<int, NewObjectListBase*>         classIDMap;   //!< The Generic Map.
     97  typedef std::map<std::string, NewObjectListBase*> classNameMap; //!< The Generic Map.
    8098
    8199  NewClassID                    _identity;          //!< The Identity of the Class (ID and Name).
     
    108126  typedef typename list::const_iterator  const_iterator;
    109127
     128  virtual base_iterator& base_begin() { };
     129  virtual base_iterator& base_end() { };
     130
     131
    110132class Iterator : public NewObjectListBase::IteratorBase
    111133  {
Note: See TracChangeset for help on using the changeset viewer.