Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2525 for code


Ignore:
Timestamp:
Dec 22, 2008, 8:35:19 PM (16 years ago)
Author:
rgrieder
Message:

Fixed MT reset bug in this branch as well to test for another possible bug. SVN should merge this without problems.

Location:
code/branches/buildsystem2/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/src/util/MultiType.cc

    r2171 r2525  
    4545        switch (type)
    4646        {
     47            case MT_null:
     48                this->reset(); return true;
    4749            case MT_char:
    4850                return this->convert<char>(); break;
  • code/branches/buildsystem2/src/util/MultiType.h

    r2171 r2525  
    305305
    306306            /** @brief Current content gets deleted. New type is MT_null */
    307             inline void                       reset()                         { if (this->value_) this->value_->reset(); }
    308 
    309             template <typename T> inline void setType()                       { this->assignValue(T());                            } /** @brief Resets the value and changes the internal type to T. */
    310             inline void                       setType(const MultiType& other) { this->setType(other.getType());                    } /** @brief Resets the value and changes the internal type to the type of the other MultiType. */
    311             inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); this->reset(); } /** @brief Resets the value and changes the internal type to the given type. */
     307            inline void                       reset()                         { if (this->value_) delete this->value_; this->value_ = 0; }
     308            /** @brief Current content gets overridden with default zero value */
     309            inline void                       resetValue()                    { if (this->value_) this->value_->reset(); }
     310
     311            template <typename T> inline void setType()                       { this->assignValue(T());                                 } /** @brief Resets the value and changes the internal type to T. */
     312            inline void                       setType(const MultiType& other) { this->setType(other.getType());                         } /** @brief Resets the value and changes the internal type to the type of the other MultiType. */
     313            inline void                       setType(MT_Type type)           { this->reset(); this->convert(type); this->resetValue(); } /** @brief Resets the value and changes the internal type to the given type. */
    312314
    313315            /** @brief Returns the current type. */
Note: See TracChangeset for help on using the changeset viewer.