Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 24, 2013, 10:30:39 PM (11 years ago)
Author:
landauf
Message:

moved meta-object-list from Identifiable to Listable, a new base class for objects with objectlists (yep)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/core/class/Identifier.h

    r9566 r9572  
    288288
    289289            bool initialiseObject(T* object, const std::string& className, bool bRootClass);
     290
     291            void addObjectToList(T* object, Listable*);
     292            void addObjectToList(T* object, Identifiable*);
    290293
    291294            void updateConfigValues(bool updateChildren = true) const;
     
    392395        else
    393396        {
    394             orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
    395             object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
     397            this->addObjectToList(object, object);
    396398
    397399            // Add pointer of type T to the map in the Identifiable instance that enables "dynamic_casts"
     
    399401            return false;
    400402        }
     403    }
     404
     405    /**
     406     * @brief Only adds the object to the object list if is a @ref Listable
     407     */
     408    template <class T>
     409    void ClassIdentifier<T>::addObjectToList(T* object, Listable*)
     410    {
     411        orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl;
     412        object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
     413    }
     414
     415    template <class T>
     416    void ClassIdentifier<T>::addObjectToList(T*, Identifiable*)
     417    {
     418        // no action
    401419    }
    402420
Note: See TracChangeset for help on using the changeset viewer.