Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7229 in orxonox.OLD for branches/resources/src/lib/util/multi_type.h


Ignore:
Timestamp:
Mar 21, 2006, 3:13:34 PM (19 years ago)
Author:
bensch
Message:

resources: some minor implementations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/resources/src/lib/util/multi_type.h

    r7225 r7229  
    9292    void debug() const;
    9393
    94     static const char* MultiTypeToString(MT_Type type);
     94    static const std::string& MultiTypeToString(MT_Type type);
    9595    static MT_Type StringToMultiType(const std::string& type);
    9696
    9797  private:
     98    /**
     99     * The stored internal Value of the MultiType is handled in this union
     100     * plus the string down below
     101     */
    98102    union MultiTypeValue
    99103    {
    100       bool              Bool;
    101       int               Int;
    102       float             Float;
    103       char              Char;
     104      bool              Bool;            //!< If Type == MT_BOOL this is the MultiType's value
     105      int               Int;             //!< If Type == MT_INT this is the MultiType's value
     106      float             Float;           //!< If Type == MT_FLOAT this is the MultiType's value
     107      char              Char;            //!< If Type == MT_CHAR this is the MultiType's value
    104108//      std::string*      String;
    105     }                   value;
    106     std::string         storedString;
    107     MT_Type             type;
     109    }                   value;           //!< The stored internal value.
     110    std::string         storedString;    //!< The String if either MT_TYPE == MT_STRING or if temporary requested
     111    MT_Type             type;            //!< The Type of the MultiString.
     112
     113    static const std::string multiTypeNames[]; //!< An array to convert from String to MT_TYPE and backwords.
    108114};
    109115
Note: See TracChangeset for help on using the changeset viewer.