Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6479


Ignore:
Timestamp:
Mar 7, 2010, 11:07:03 AM (15 years ago)
Author:
dafrick
Message:

Added XMLPortParam to add one single template to BaseObject for ease of use.

Location:
code/branches/pickup3/src/libraries/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup3/src/libraries/core/BaseObject.cc

    r6417 r6479  
    115115        XMLPortParam(BaseObject, "active", setActive, isActive, xmlelement, mode);
    116116        XMLPortParam(BaseObject, "mainstate", setMainStateName, getMainStateName, xmlelement, mode);
    117 
     117        XMLPortParamTemplate(BaseObject, "template", addTemplate, getSingleTemplate, xmlelement, mode, const std::string&);
     118       
    118119        XMLPortObjectTemplate(BaseObject, Template, "templates", addTemplate, getTemplate, xmlelement, mode, Template*);
    119120        XMLPortObject(BaseObject, BaseObject, "eventlisteners", addEventListener, getEventListener, xmlelement, mode);
     
    190191
    191192    /**
     193        @brief Returns the name of the first Template.
     194        @return The name as string.
     195    */
     196    const std::string& BaseObject::getSingleTemplate(void) const
     197    {
     198        if(this->templates_.empty())
     199            return BLANKSTRING;
     200
     201        return (*this->templates_.begin())->getName();
     202    }
     203
     204    /**
    192205        @brief Returns the Template with the given index.
    193206        @param index The index
  • code/branches/pickup3/src/libraries/core/BaseObject.h

    r6417 r6479  
    195195
    196196            void setXMLName(const std::string& name);
     197            const std::string& getSingleTemplate(void) const;
    197198            Template* getTemplate(unsigned int index) const;
    198199            void registerEventStates();
Note: See TracChangeset for help on using the changeset viewer.