Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9586 for code/branches


Ignore:
Timestamp:
Mar 26, 2013, 11:30:57 PM (12 years ago)
Author:
landauf
Message:

call setConfigValues() only if the class is actually a Configurable

File:
1 edited

Legend:

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

    r9572 r9586  
    288288
    289289            bool initialiseObject(T* object, const std::string& className, bool bRootClass);
     290
     291            void setConfigValues(T* object, Configurable*) const;
     292            void setConfigValues(T* object, Identifiable*) const;
    290293
    291294            void addObjectToList(T* object, Listable*);
     
    390393            }
    391394
    392             object->setConfigValues();
     395            this->setConfigValues(object, object);
    393396            return true;
    394397        }
     
    404407
    405408    /**
     409     * @brief Only configures the object if is a @ref Configurable
     410     */
     411    template <class T>
     412    void ClassIdentifier<T>::setConfigValues(T* object, Configurable*) const
     413    {
     414        object->setConfigValues();
     415    }
     416
     417    template <class T>
     418    void ClassIdentifier<T>::setConfigValues(T*, Identifiable*) const
     419    {
     420        // no action
     421    }
     422
     423    /**
    406424     * @brief Only adds the object to the object list if is a @ref Listable
    407425     */
     
    429447
    430448        for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
    431             it->setConfigValues();
     449            this->setConfigValues(*it, *it);
    432450
    433451        if (updateChildren)
Note: See TracChangeset for help on using the changeset viewer.