Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2505


Ignore:
Timestamp:
Dec 17, 2008, 5:23:02 PM (15 years ago)
Author:
rgrieder
Message:
  • Removed XMLPortVariableOnLoad macro (can't possibly work at all)
  • Added some static_casts (accidentally found while debugging)
Location:
code/branches/presentation/src/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/core/ObjectListIterator.h

    r1747 r2505  
    123123            {
    124124                if (this->element_)
    125                     this->element_ = (ObjectListElement<T>*)this->element_->next_;
     125                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
    126126                return *this;
    127127            }
     
    135135                ObjectListIterator<T> copy = *this;
    136136                if (this->element_)
    137                     this->element_ = (ObjectListElement<T>*)this->element_->next_;
     137                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->next_);
    138138                return copy;
    139139            }
     
    146146            {
    147147                if (this->element_)
    148                     this->element_ = (ObjectListElement<T>*)this->element_->prev_;
     148                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
    149149                return *this;
    150150            }
     
    158158                ObjectListIterator<T> copy = *this;
    159159                if (this->element_)
    160                     this->element_ = (ObjectListElement<T>*)this->element_->prev_;
     160                    this->element_ = static_cast<ObjectListElement<T>*>(this->element_->prev_);
    161161                return copy;
    162162            }
  • code/branches/presentation/src/core/XMLPort.h

    r2485 r2505  
    9393    static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##loadexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader")); \
    9494    static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##saveexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getSaver (variable)), std::string( #classname ) + "::" + #variable + "saver" )); \
    95     XMLPortParamGeneric(xmlcontainer##variable, classname, orxonox::XMLPortVariableHelperClass, &xmlcontainer##variable##dummy, paramname, xmlcontainer##variable##loadexecutor, xmlcontainer##variable##saveexecutor, xmlelement, mode)
    96 
    97 /**
    98     @brief Declares an XML attribute with a name, which will be set through a variable and gotten from a function.
    99     @param classname The name of the class owning this param
    100     @param paramname The name of the attribute
    101     @param variable Name of the variable used to save the value
    102     @param savefunction A function to get the value of the param from the object (~a get-function)
    103     @param xmlelement The XMLElement, you get this from the XMLPort function
    104     @param mode The mode (load or save), you get this from the XMLPort function
    105 
    106     In the XML file, a param or attribute will be set like this:
    107     <classname paramname="value" />
    108 
    109     The macro will then store "value" in the variable or read it when saving.
    110 */
    111 #define XMLPortParamVariableOnLoad(classname, paramname, variable, savefunction, xmlelement, mode) \
    112     static XMLPortVariableHelperClass xmlcontainer##variable##dummy((void*)&variable); \
    113     static ExecutorMember<orxonox::XMLPortVariableHelperClass>* xmlcontainer##variable##loadexecutor = static_cast<ExecutorMember<orxonox::XMLPortVariableHelperClass>*>(&(orxonox::createExecutor(orxonox::createFunctor(orxonox::XMLPortVariableHelperClass::getLoader(variable)), std::string( #classname ) + "::" + #variable + "loader"))); \
    114     static ExecutorMember<classname>* xmlcontainer##loadfunction##savefunction##saveexecutor = orxonox::createExecutor(orxonox::createFunctor(&classname::savefunction), std::string( #classname ) + "::" + #savefunction); \
    11595    XMLPortParamGeneric(xmlcontainer##variable, classname, orxonox::XMLPortVariableHelperClass, &xmlcontainer##variable##dummy, paramname, xmlcontainer##variable##loadexecutor, xmlcontainer##variable##saveexecutor, xmlelement, mode)
    11696
Note: See TracChangeset for help on using the changeset viewer.