Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3196 for code/trunk/src/util


Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (15 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
28 edited
3 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/util/CMakeLists.txt

    r3089 r3196  
    1818 #
    1919
    20 SET_SOURCE_FILES(UTIL_FILES
    21   CRC32.h
    22   Clipboard.h
    23   Convert.h
    24   Debug.h
    25   Exception.h
    26   ExprParser.h
    27   Math.h
    28   MathConvert.h
    29   MultiType.h
    30   MultiTypeValue.h
    31   OrxEnum.h
    32   OutputBuffer.h
    33   OutputHandler.h
    34   SignalHandler.h
    35   Sleep.h
    36   String.h
    37   SubString.h
    38   UtilPrereqs.h
    39   mbool.h
    40  
     20SET_SOURCE_FILES(UTIL_SRC_FILES
    4121  Clipboard.cc
    4222  CRC32.cc
     
    5232  SubString.cc
    5333)
    54 #GET_ALL_HEADER_FILES(UTIL_HDR_FILES)
    55 #SET(UTIL_FILES ${UTIL_SRC_FILES} ${UTIL_HDR_FILES})
    56 GENERATE_SOURCE_GROUPS(${UTIL_FILES})
    57 # Also add OrxonoxConfig to have it least somewhere in the IDE
    58 LIST(APPEND UTIL_FILES
    59   ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h
    60   ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in
    61   ${CMAKE_BINARY_DIR}/src/SpecialConfig.h
    62   ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in
    63 )
    64 SOURCE_GROUP("" FILES
    65   ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h
    66   ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in
    67   ${CMAKE_BINARY_DIR}/src/SpecialConfig.h
    68   ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in
    69 )
    7034
    7135IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
     
    7438ENDIF()
    7539
    76 ADD_LIBRARY(util SHARED ${UTIL_FILES})
    77 SET_TARGET_PROPERTIES(util PROPERTIES DEFINE_SYMBOL "UTIL_SHARED_BUILD")
    78 TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARY})
    79 
    80 ORXONOX_INSTALL(util)
     40ORXONOX_ADD_LIBRARY(util
     41  FIND_HEADER_FILES
     42  DEFINE_SYMBOL
     43    "UTIL_SHARED_BUILD"
     44  LINK_LIBRARIES
     45    ${OGRE_LIBRARY}
     46  SOURCE_FILES
     47    ${UTIL_SRC_FILES}
     48)
  • code/trunk/src/util/CRC32.h

    r2710 r3196  
    3131
    3232#include "UtilPrereqs.h"
    33 #include <iostream>
    3433
    3534namespace orxonox
  • code/trunk/src/util/Clipboard.cc

    r2710 r3196  
    112112namespace orxonox
    113113{
    114     std::string clipboard = ""; //!< Keeps the text of our internal clipboard
     114    static std::string clipboard = ""; //!< Keeps the text of our internal clipboard
    115115
    116116    /**
  • code/trunk/src/util/Clipboard.h

    r2171 r3196  
    4343
    4444#include "UtilPrereqs.h"
    45 
    4645#include <string>
    4746
  • code/trunk/src/util/Convert.h

    r2710 r3196  
    4040#include <string>
    4141#include <sstream>
    42 #include <istream>
    43 #include <ostream>
    4442#include <typeinfo>
    4543
     
    123121namespace orxonox
    124122{
    125     namespace
     123    namespace detail
    126124    {
    127125        //! Little template that maps integers to entire types (Alexandrescu 2001)
     
    139137    struct ConverterFallback
    140138    {
    141         static bool convert(ToType* output, const FromType& input)
     139        FORCEINLINE static bool convert(ToType* output, const FromType& input)
    142140        {
    143141            COUT(2) << "Could not convert value of type " << typeid(FromType).name()
     
    151149    struct ConverterFallback<FromType*, ToType*>
    152150    {
    153         static bool convert(ToType** output, FromType* const input)
     151        FORCEINLINE static bool convert(ToType** output, FromType* const input)
    154152        {
    155153            ToType* temp = dynamic_cast<ToType*>(input);
     
    174172struct ConverterStringStream
    175173{
    176     static bool convert(ToType* output, const FromType& input)
     174    FORCEINLINE static bool convert(ToType* output, const FromType& input)
    177175    {
    178176        return orxonox::ConverterFallback<FromType, ToType>::convert(output, input);
     
    188186{
    189187    template <class FromType>
    190     inline bool operator <<(std::ostream& outstream,  const FromType& input)
     188    FORCEINLINE bool operator <<(std::ostream& outstream,  const FromType& input)
    191189    {
    192190        std::string temp;
     
    205203struct ConverterStringStream<FromType, std::string>
    206204{
    207     static bool convert(std::string* output, const FromType& input)
     205    FORCEINLINE static bool convert(std::string* output, const FromType& input)
    208206    {
    209207        using namespace fallbackTemplates;
     
    228226{
    229227    template <class ToType>
    230     inline bool operator >>(std::istream& instream, ToType& output)
     228    FORCEINLINE bool operator >>(std::istream& instream, ToType& output)
    231229    {
    232230        return orxonox::ConverterFallback<std::string, ToType>
     
    239237struct ConverterStringStream<std::string, ToType>
    240238{
    241     static bool convert(ToType* output, const std::string& input)
     239    FORCEINLINE static bool convert(ToType* output, const std::string& input)
    242240    {
    243241        using namespace fallbackTemplates;
     
    262260    // implicit cast not possible, try stringstream conversion next
    263261    template <class FromType, class ToType>
    264     inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<false>)
     262    FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<false>)
    265263    {
    266264        return ConverterStringStream<FromType, ToType>::convert(output, input);
     
    269267    // We can cast implicitely
    270268    template <class FromType, class ToType>
    271     inline bool convertImplicitely(ToType* output, const FromType& input, orxonox::Int2Type<true>)
     269    FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<true>)
    272270    {
    273271        (*output) = static_cast<ToType>(input);
     
    284282    struct ConverterExplicit
    285283    {
    286         static bool convert(ToType* output, const FromType& input)
     284        FORCEINLINE static bool convert(ToType* output, const FromType& input)
    287285        {
    288286            // Try implict cast and probe first. If a simple cast is not possible, it will not compile
    289287            // We therefore have to out source it into another template function
    290288            const bool probe = ImplicitConversion<FromType, ToType>::exists;
    291             return convertImplicitely(output, input, orxonox::Int2Type<probe>());
     289            return convertImplicitely(output, input, detail::Int2Type<probe>());
    292290        }
    293291    };
     
    306304    */
    307305    template <class FromType, class ToType>
    308     inline bool convertValue(ToType* output, const FromType& input)
     306    FORCEINLINE bool convertValue(ToType* output, const FromType& input)
    309307    {
    310308        return ConverterExplicit<FromType, ToType>::convert(output, input);
    311     }
    312 
    313     // For compatibility reasons. The same, but with capital ConvertValue
    314     template<class FromType, class ToType>
    315     inline bool ConvertValue(ToType* output, const FromType& input)
    316     {
    317         return convertValue(output, input);
    318309    }
    319310
     
    331322    */
    332323    template<class FromType, class ToType>
    333     inline bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
     324    FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)
    334325    {
    335326        if (convertValue(output, input))
     
    342333    }
    343334
    344     // for compatibility reason. (capital 'c' in ConvertValue)
    345     template<class FromType, class ToType>
    346     inline bool ConvertValue(ToType* output, const FromType& input, const ToType& fallback)
    347     {
    348         return convertValue(output, input, fallback);
    349     }
    350 
    351335    // Directly returns the converted value, even if the conversion was not successful.
    352336    template<class FromType, class ToType>
    353     inline ToType getConvertedValue(const FromType& input)
     337    FORCEINLINE ToType getConvertedValue(const FromType& input)
    354338    {
    355339        ToType output;
     
    360344    // Directly returns the converted value, but uses the fallback on failure.
    361345    template<class FromType, class ToType>
    362     inline ToType getConvertedValue(const FromType& input, const ToType& fallback)
     346    FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)
    363347    {
    364348        ToType output;
     
    370354    // That means you can call it exactly like static_cast<ToType>(fromTypeValue).
    371355    template<class ToType, class FromType>
    372     inline ToType omni_cast(const FromType& input)
     356    FORCEINLINE ToType multi_cast(const FromType& input)
    373357    {
    374358        ToType output;
     
    379363    // convert to string Shortcut
    380364    template <class FromType>
    381     inline std::string convertToString(FromType value)
    382     {
    383       return getConvertedValue<FromType, std::string>(value);
     365    FORCEINLINE std::string convertToString(FromType value)
     366    {
     367        return getConvertedValue<FromType, std::string>(value);
    384368    }
    385369
    386370    // convert from string Shortcut
    387371    template <class ToType>
    388     inline ToType convertFromString(std::string str)
    389     {
    390       return getConvertedValue<std::string, ToType>(str);
     372    FORCEINLINE ToType convertFromString(std::string str)
     373    {
     374        return getConvertedValue<std::string, ToType>(str);
    391375    }
    392376
     
    399383    struct ConverterExplicit<const char*, ToType>
    400384    {
    401         static bool convert(ToType* output, const char* input)
     385        FORCEINLINE static bool convert(ToType* output, const char* input)
    402386        {
    403387            return convertValue<std::string, ToType>(output, input);
     
    409393    struct ConverterExplicit<char, std::string>
    410394    {
    411         static bool convert(std::string* output, const char input)
     395        FORCEINLINE static bool convert(std::string* output, const char input)
    412396        {
    413397            *output = std::string(1, input);
     
    418402    struct ConverterExplicit<unsigned char, std::string>
    419403    {
    420         static bool convert(std::string* output, const unsigned char input)
     404        FORCEINLINE static bool convert(std::string* output, const unsigned char input)
    421405        {
    422406            *output = std::string(1, input);
     
    427411    struct ConverterExplicit<std::string, char>
    428412    {
    429         static bool convert(char* output, const std::string input)
     413        FORCEINLINE static bool convert(char* output, const std::string input)
    430414        {
    431415            if (input != "")
     
    439423    struct ConverterExplicit<std::string, unsigned char>
    440424    {
    441         static bool convert(unsigned char* output, const std::string input)
     425        FORCEINLINE static bool convert(unsigned char* output, const std::string input)
    442426        {
    443427            if (input != "")
     
    454438    struct ConverterExplicit<bool, std::string>
    455439    {
    456         static bool convert(std::string* output, const bool& input)
     440        FORCEINLINE static bool convert(std::string* output, const bool& input)
    457441        {
    458442            if (input)
  • code/trunk/src/util/Debug.h

    r2171 r3196  
    6363#include "UtilPrereqs.h"
    6464
    65 #include <stdio.h>
    66 
    6765#include "OutputHandler.h"
    6866
     
    7371        @return The soft debug level
    7472    */
    75     static inline int getSoftDebugLevel()
     73    inline int getSoftDebugLevel()
    7674    {
    7775        return OutputHandler::getSoftDebugLevel();
  • code/trunk/src/util/Exception.cc

    r3068 r3196  
    3737namespace orxonox
    3838{
    39     Exception::Exception(const std::string& description, int lineNumber,
     39    Exception::Exception(const std::string& description, unsigned int lineNumber,
    4040                         const char* filename, const char* functionName)
    4141        : description_(description)
     
    5252    { }
    5353
     54    /**
     55    @remarks
     56        The composed full description gets stored to fullDescription_. But for compliance
     57        with std::exception, this method has to be const. Hence fullDescription_ is declared
     58        as mutable.
     59    */
    5460    const std::string& Exception::getFullDescription() const
    5561    {
  • code/trunk/src/util/Exception.h

    r3068 r3196  
    3030@file
    3131@brief
    32     Declaration of the Exception class.
     32    Declaration of facilities to handle exceptions.
    3333*/
    3434
     
    3838#include "UtilPrereqs.h"
    3939
     40#include <exception>
     41#include <sstream>
    4042#include <string>
    41 #include <exception>
    42 #include <cassert>
    4343#include "Debug.h"
    4444
    4545namespace orxonox
    4646{
     47    /**
     48    @brief
     49        Base class for all exceptions (derived from std::exception).
     50    @details
     51        This class provides support for information about the file, the line
     52        and the function the error occured.
     53    */
    4754    class _UtilExport Exception : public std::exception
    4855    {
    4956    public:
    50 
    51         Exception(const std::string& description, int lineNumber,
     57        /**
     58        @brief
     59            Creates the exception but doesn't yet compose the full descrption (because of the virtual functions)
     60        @param description
     61            Exception description as string. This message is supposed to help developers!
     62        */
     63        Exception(const std::string& description, unsigned int lineNumber,
    5264                  const char* filename, const char* functionName);
     65        //! Simplified constructor with just a description. If you need more, use the other one.
    5366        Exception(const std::string& description);
    5467
    55         /// Needed for  compatibility with std::exception (from Ogre::Exception)
     68        //! Needed for compatibility with std::exception
    5669        virtual ~Exception() throw() { }
    5770
     71        //! Returns a full description with type, line, file and function
    5872        virtual const std::string& getFullDescription() const;
     73        //! Returns the string name of the exception type
    5974        virtual std::string        getTypeName()        const = 0;
     75        //! Returns the short developer written exception
    6076        virtual const std::string& getDescription()     const { return this->description_; }
    61         virtual const int          getLineNumber()      const { return this->lineNumber_; }
     77        //! Returns the line number on which the exception occurred.
     78        virtual const unsigned int getLineNumber()      const { return this->lineNumber_; }
     79        //! Returns the function in which the exception occurred.
    6280        virtual const std::string& getFunctionName()    const { return this->functionName_; }
     81        //! Returns the filename in which the exception occurred.
     82        virtual const std::string& getFilename()        const { return this->filename_; }
    6383
    64         /// Override std::exception::what (from Ogre::Exception)
     84        //! Returns a full description of the error.
    6585        const char* what() const throw() { return getFullDescription().c_str(); }
    6686
    6787    protected:
    68         std::string description_;
    69         int lineNumber_;
    70         std::string functionName_;
    71         std::string filename_;
     88        std::string description_;             //!< User typed text about why the exception occurred
     89        unsigned int lineNumber_;             //!< Line on which the exception occurred
     90        std::string functionName_;            //!< Function (including namespace and class) where the exception occurred
     91        std::string filename_;                //!< File where the exception occurred
    7292        // mutable because "what()" is a const method
    73         mutable std::string fullDescription_;
     93        mutable std::string fullDescription_; //!< Full description with line, file and function
    7494    };
    7595
    76 
     96//! Creates a new type of exception that inherits from tracker::Exception
    7797#define CREATE_ORXONOX_EXCEPTION(ExceptionName)                                     \
    7898    class ExceptionName##Exception : public Exception                               \
    7999    {                                                                               \
    80100    public:                                                                         \
    81         ExceptionName##Exception(const std::string& description, int lineNumber,    \
    82                   const char* filename, const char* functionName)                   \
    83                   : Exception(description, lineNumber, filename, functionName)      \
     101        ExceptionName##Exception(const std::string& description,                    \
     102                unsigned int lineNumber, const char* filename,                      \
     103                const char* functionName)                                           \
     104            : Exception(description, lineNumber, filename, functionName)            \
    84105        { }                                                                         \
    85106                                                                                    \
    86107        ExceptionName##Exception(const std::string& description)                    \
    87                   : Exception(description)                                          \
     108            : Exception(description)                                                \
    88109        { }                                                                         \
    89110                                                                                    \
     
    91112                                                                                    \
    92113        std::string getTypeName() const { return #ExceptionName; }                  \
    93     };
     114    }
    94115
    95116    // Creates all possible exception types.
    96117    // If you want to add a new type, simply copy and adjust a new line here.
     118#ifndef DOXYGEN_SHOULD_SKIP_THIS
    97119    CREATE_ORXONOX_EXCEPTION(General);
    98120    CREATE_ORXONOX_EXCEPTION(FileNotFound);
     
    106128    CREATE_ORXONOX_EXCEPTION(NoGraphics);
    107129    CREATE_ORXONOX_EXCEPTION(AbortLoading);
    108 }
     130#endif
    109131
    110132    /**
    111133    @brief
    112         Helper function that creates an exception, displays the message, but doesn't throw it.
     134        Helper function that forwards an exception and displays the message.
     135    @details
     136        This is necessary because only when using 'throw' the objects storage is managed.
    113137    */
    114138    template <class T>
    115     inline const T& InternalHandleException(const T& exception)
     139    inline const T& exceptionThrowerHelper(const T& exception)
    116140    {
    117141        // let the catcher decide whether to display the message below level 4
     
    120144    }
    121145
    122 #define ThrowException(type, description) \
    123     throw InternalHandleException(type##Exception(description, __LINE__, __FILE__, __FUNCTIONNAME__))
     146/**
     147@brief
     148    Throws an exception and logs a message beforehand.
     149@param type
     150    Type of the exception as literal (General, Initialisation, etc.)
     151@param description
     152    Exception description as string
     153*/
     154#define ThrowException(type, description, ...) \
     155    throw orxonox::exceptionThrowerHelper(type##Exception(static_cast<std::ostringstream&>(std::ostringstream().flush() << description).str(), __LINE__, __FILE__, __FUNCTIONNAME__))
    124156
    125     // define an assert macro that can display a message
    126 #ifndef NDEBUG
    127 #define OrxAssert(Assertion, ErrorMessage) \
    128     Assertion ? ((void)0) : (void)(orxonox::OutputHandler::getOutStream().setOutputLevel(ORX_ERROR) << ErrorMessage << std::endl); \
    129     assert(Assertion)
    130 #else
    131 #define OrxAssert(condition, errorMessage)  ((void)0)
    132 #endif
     157} /* namespace orxonox */
    133158
    134159#endif /* _Exception_H__ */
  • code/trunk/src/util/ExprParser.cc

    r2171 r3196  
    3535#include <cmath>
    3636#include <cstring>
    37 #include <stdlib.h>
     37#include <cstdlib>
    3838
    3939// macros for easier if, else statements
     
    247247            return 0;
    248248        }
    249         else if (*reading_stream > 47 && *reading_stream < 59 || *reading_stream == 46)
     249        else if ((*reading_stream > 47 && *reading_stream < 59) || *reading_stream == 46)
    250250        {  // number
    251251            value = strtod(reading_stream, const_cast<char**>(&reading_stream));
    252252        }
    253         else if (*reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
     253        else if ((*reading_stream > 64 && *reading_stream < 91) || (*reading_stream > 96 && *reading_stream < 123) || *reading_stream == 46)
    254254        {  // variable or function
    255255            char* word = new char[256];
     
    384384        char* word = str;
    385385        int counter = 0;
    386         while (*reading_stream > 47 && *reading_stream < 58 || *reading_stream > 64 && *reading_stream < 91 || *reading_stream > 96 && *reading_stream < 123 || *reading_stream == 46)
     386        while ((*reading_stream > 47 && *reading_stream < 58) || (*reading_stream > 64 && *reading_stream < 91) || (*reading_stream > 96 && *reading_stream < 123) || *reading_stream == 46)
    387387        {
    388388            *word++ = *reading_stream++;
  • code/trunk/src/util/ExprParser.h

    r2171 r3196  
    7272
    7373        ExprParser(const std::string& str);
    74         std::string& getRemains() { return  this->remains_; }
    75         double       getResult()  { return  this->result_; }
    76         bool         getSuccess() { return !this->failed_; }
     74        const std::string& getRemains() { return  this->remains_; }
     75        double             getResult()  { return  this->result_; }
     76        bool               getSuccess() { return !this->failed_; }
    7777
    7878    private:
  • code/trunk/src/util/Math.cc

    r3049 r3196  
    3535
    3636#include <OgrePlane.h>
     37
    3738#include "MathConvert.h"
    3839#include "SubString.h"
    39 
    40 // Do not remove this include to avoid linker errors.
     40// Do not remove this include, it avoids linker errors.
    4141#include "mbool.h"
    4242
     
    238238        if (tokens.size() >= 2)
    239239        {
    240             if (!ConvertValue(&(output->x), tokens[0]))
    241                 return false;
    242             if (!ConvertValue(&(output->y), tokens[1]))
     240            if (!convertValue(&(output->x), tokens[0]))
     241                return false;
     242            if (!convertValue(&(output->y), tokens[1]))
    243243                return false;
    244244
     
    261261        if (tokens.size() >= 3)
    262262        {
    263             if (!ConvertValue(&(output->x), tokens[0]))
    264                 return false;
    265             if (!ConvertValue(&(output->y), tokens[1]))
    266                 return false;
    267             if (!ConvertValue(&(output->z), tokens[2]))
     263            if (!convertValue(&(output->x), tokens[0]))
     264                return false;
     265            if (!convertValue(&(output->y), tokens[1]))
     266                return false;
     267            if (!convertValue(&(output->z), tokens[2]))
    268268                return false;
    269269
     
    286286        if (tokens.size() >= 4)
    287287        {
    288             if (!ConvertValue(&(output->x), tokens[0]))
    289                 return false;
    290             if (!ConvertValue(&(output->y), tokens[1]))
    291                 return false;
    292             if (!ConvertValue(&(output->z), tokens[2]))
    293                 return false;
    294             if (!ConvertValue(&(output->w), tokens[3]))
     288            if (!convertValue(&(output->x), tokens[0]))
     289                return false;
     290            if (!convertValue(&(output->y), tokens[1]))
     291                return false;
     292            if (!convertValue(&(output->z), tokens[2]))
     293                return false;
     294            if (!convertValue(&(output->w), tokens[3]))
    295295                return false;
    296296
     
    309309        if (tokens.size() >= 4)
    310310        {
    311             if (!ConvertValue(&(output->w), tokens[0]))
    312                 return false;
    313             if (!ConvertValue(&(output->x), tokens[1]))
    314                 return false;
    315             if (!ConvertValue(&(output->y), tokens[2]))
    316                 return false;
    317             if (!ConvertValue(&(output->z), tokens[3]))
     311            if (!convertValue(&(output->w), tokens[0]))
     312                return false;
     313            if (!convertValue(&(output->x), tokens[1]))
     314                return false;
     315            if (!convertValue(&(output->y), tokens[2]))
     316                return false;
     317            if (!convertValue(&(output->z), tokens[3]))
    318318                return false;
    319319
     
    332332        if (tokens.size() >= 3)
    333333        {
    334             if (!ConvertValue(&(output->r), tokens[0]))
    335                 return false;
    336             if (!ConvertValue(&(output->g), tokens[1]))
    337                 return false;
    338             if (!ConvertValue(&(output->b), tokens[2]))
     334            if (!convertValue(&(output->r), tokens[0]))
     335                return false;
     336            if (!convertValue(&(output->g), tokens[1]))
     337                return false;
     338            if (!convertValue(&(output->b), tokens[2]))
    339339                return false;
    340340            if (tokens.size() >= 4)
    341341            {
    342                 if (!ConvertValue(&(output->a), tokens[3]))
     342                if (!convertValue(&(output->a), tokens[3]))
    343343                    return false;
    344344            }
  • code/trunk/src/util/Math.h

    r2872 r3196  
    3737#include "UtilPrereqs.h"
    3838
    39 #include <ostream>
    4039#include <string>
    4140#include <cmath>
    42 #include <boost/static_assert.hpp>
    4341
    4442#include <OgreMath.h>
     
    4644#include <OgreVector3.h>
    4745#include <OgreVector4.h>
    48 #include <OgreMatrix3.h>
    49 #include <OgreMatrix4.h>
    5046#include <OgreQuaternion.h>
    5147#include <OgreColourValue.h>
     
    5854namespace orxonox
    5955{
    60     using Ogre::Radian;
    61     using Ogre::Degree;
    62     using Ogre::Vector2;
    63     using Ogre::Vector3;
    64     using Ogre::Vector4;
    65     using Ogre::Matrix3;
    66     using Ogre::Matrix4;
    67     using Ogre::Quaternion;
    68     using Ogre::ColourValue;
    69 
    70     // Also define our own transform space enum
    71     namespace TransformSpace
    72     {
    73         /**
    74         @brief
    75             Enumeration denoting the spaces which a transform can be relative to.
    76         */
    77         enum Enum
    78         {
    79             //! Transform is relative to the local space
    80             Local,
    81             //! Transform is relative to the space of the parent node
    82             Parent,
    83             //! Transform is relative to world space
    84             World
    85         };
    86     }
    87 
    8856    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
    8957    _UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);
     
    217185    template <> inline orxonox::Quaternion  zeroise<orxonox::Quaternion>()  { return orxonox::Quaternion (0, 0, 0, 0); }
    218186
     187    //! Provides zero value symbols that can be returned as reference
     188    template <typename T>
     189    struct NilValue
     190    {
     191        inline operator const T&() const
     192        {
     193            return value;
     194        }
     195        static T value;
     196    };
     197    template <typename T>
     198    T NilValue<T>::value = zeroise<T>();
     199
    219200    /**
    220201        @brief Interpolates between two values for a time between 0 and 1.
     
    225206    */
    226207    template <typename T>
    227     T interpolate(float time, const T& start, const T& end)
     208    inline T interpolate(float time, const T& start, const T& end)
    228209    {
    229210        return time * (end - start) + start;
     
    238219    */
    239220    template <typename T>
    240     T interpolateSmooth(float time, const T& start, const T& end)
     221    inline T interpolateSmooth(float time, const T& start, const T& end)
    241222    {
    242223        return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;
     
    248229    inline float rnd()
    249230    {
    250         return rand() / (RAND_MAX + 1.0);
     231        return rand() / (RAND_MAX + 1.0f);
    251232    }
    252233
     
    275256    inline float rndsgn()
    276257    {
    277         return ((rand() & 0x2) - 1); // rand() & 0x2 is either 2 or 0
     258        return static_cast<float>((rand() & 0x2) - 1); // rand() & 0x2 is either 2 or 0
    278259    }
    279260
     
    283264    {
    284265    public:
    285       IntVector2() : x(0), y(0) { }
    286       IntVector2(int _x, int _y) : x(_x), y(_y) { }
    287       int x;
    288       int y;
     266        IntVector2() : x(0), y(0) { }
     267        IntVector2(int _x, int _y) : x(_x), y(_y) { }
     268        int x;
     269        int y;
    289270    };
    290271
     
    292273    {
    293274    public:
    294       IntVector3() : x(0), y(0), z(0) { }
    295       IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
    296       int x;
    297       int y;
    298       int z;
     275        IntVector3() : x(0), y(0), z(0) { }
     276        IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
     277        int x;
     278        int y;
     279        int z;
    299280    };
    300281}
  • code/trunk/src/util/MathConvert.h

    r2171 r3196  
    5050    struct ConverterExplicit<orxonox::Vector2, std::string>
    5151    {
    52         static bool convert(std::string* output, const orxonox::Vector2& input)
     52        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)
    5353        {
    5454            std::ostringstream ostream;
     
    6666    struct ConverterExplicit<orxonox::Vector3, std::string>
    6767    {
    68         static bool convert(std::string* output, const orxonox::Vector3& input)
     68        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)
    6969        {
    7070            std::ostringstream ostream;
     
    8282    struct ConverterExplicit<orxonox::Vector4, std::string>
    8383    {
    84         static bool convert(std::string* output, const orxonox::Vector4& input)
     84        FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)
    8585        {
    8686            std::ostringstream ostream;
     
    9898    struct ConverterExplicit<orxonox::Quaternion, std::string>
    9999    {
    100         static bool convert(std::string* output, const orxonox::Quaternion& input)
     100        FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)
    101101        {
    102102            std::ostringstream ostream;
     
    114114    struct ConverterExplicit<orxonox::ColourValue, std::string>
    115115    {
    116         static bool convert(std::string* output, const orxonox::ColourValue& input)
     116        FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)
    117117        {
    118118            std::ostringstream ostream;
     
    156156    struct ConverterFallback<orxonox::Radian, ToType>
    157157    {
    158         static bool convert(ToType* output, const orxonox::Radian& input)
     158        FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)
    159159        {
    160160            return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
     
    166166    struct ConverterFallback<orxonox::Degree, ToType>
    167167    {
    168         static bool convert(ToType* output, const orxonox::Degree& input)
     168        FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)
    169169        {
    170170            return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
     
    176176    struct ConverterFallback<FromType, orxonox::Radian>
    177177    {
    178         static bool convert(orxonox::Radian* output, const FromType& input)
     178        FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)
    179179        {
    180180            float temp;
     
    193193    struct ConverterFallback<FromType, orxonox::Degree>
    194194    {
    195         static bool convert(orxonox::Degree* output, const FromType& input)
     195        FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)
    196196        {
    197197            float temp;
  • code/trunk/src/util/MultiType.cc

    r2662 r3196  
    159159    }
    160160
    161     MultiType::operator char()                 const { return (this->value_) ? ((this->value_->type_ == MT_char       ) ? ((MT_Value<char>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    162     MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? ((MT_Value<unsigned char>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    163     MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? ((MT_Value<short>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    164     MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? ((MT_Value<unsigned short>      *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    165     MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? ((MT_Value<int>                 *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    166     MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? ((MT_Value<unsigned int>        *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    167     MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? ((MT_Value<long>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    168     MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? ((MT_Value<unsigned long>       *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    169     MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? ((MT_Value<long long>           *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    170     MultiType::operator unsigned long long()   const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong  ) ? ((MT_Value<unsigned long long>  *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    171     MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? ((MT_Value<float>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    172     MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? ((MT_Value<double>              *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    173     MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? ((MT_Value<long double>         *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    174     MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? ((MT_Value<bool>                *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    175     MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? ((MT_Value<void*>               *)this->value_)->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
    176     MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? ((MT_Value<std::string>         *)this->value_)->value_ : (*this->value_)) : zeroise<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
    177     MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? ((MT_Value<orxonox::Vector2>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
    178     MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? ((MT_Value<orxonox::Vector3>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
    179     MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? ((MT_Value<orxonox::Vector4>    *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
    180     MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? ((MT_Value<orxonox::ColourValue>*)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
    181     MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? ((MT_Value<orxonox::Quaternion> *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
    182     MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? ((MT_Value<orxonox::Radian>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
    183     MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? ((MT_Value<orxonox::Degree>     *)this->value_)->value_ : (*this->value_)) : zeroise<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
     161    MultiType::operator char()                 const { return (this->value_) ? ((this->value_->type_ == MT_char       ) ? (static_cast<MT_Value<char>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     162    MultiType::operator unsigned char()        const { return (this->value_) ? ((this->value_->type_ == MT_uchar      ) ? (static_cast<MT_Value<unsigned char>       *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     163    MultiType::operator short()                const { return (this->value_) ? ((this->value_->type_ == MT_short      ) ? (static_cast<MT_Value<short>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     164    MultiType::operator unsigned short()       const { return (this->value_) ? ((this->value_->type_ == MT_ushort     ) ? (static_cast<MT_Value<unsigned short>      *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     165    MultiType::operator int()                  const { return (this->value_) ? ((this->value_->type_ == MT_int        ) ? (static_cast<MT_Value<int>                 *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     166    MultiType::operator unsigned int()         const { return (this->value_) ? ((this->value_->type_ == MT_uint       ) ? (static_cast<MT_Value<unsigned int>        *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     167    MultiType::operator long()                 const { return (this->value_) ? ((this->value_->type_ == MT_long       ) ? (static_cast<MT_Value<long>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     168    MultiType::operator unsigned long()        const { return (this->value_) ? ((this->value_->type_ == MT_ulong      ) ? (static_cast<MT_Value<unsigned long>       *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     169    MultiType::operator long long()            const { return (this->value_) ? ((this->value_->type_ == MT_longlong   ) ? (static_cast<MT_Value<long long>           *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     170    MultiType::operator unsigned long long()   const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong  ) ? (static_cast<MT_Value<unsigned long long>  *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     171    MultiType::operator float()                const { return (this->value_) ? ((this->value_->type_ == MT_float      ) ? (static_cast<MT_Value<float>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     172    MultiType::operator double()               const { return (this->value_) ? ((this->value_->type_ == MT_double     ) ? (static_cast<MT_Value<double>              *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     173    MultiType::operator long double()          const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? (static_cast<MT_Value<long double>         *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     174    MultiType::operator bool()                 const { return (this->value_) ? ((this->value_->type_ == MT_bool       ) ? (static_cast<MT_Value<bool>                *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     175    MultiType::operator void*()                const { return (this->value_) ? ((this->value_->type_ == MT_void       ) ? (static_cast<MT_Value<void*>               *>(this->value_))->value_ : (*this->value_)) : 0;                      } /** @brief Returns the current value, converted to the requested type. */
     176    MultiType::operator std::string()          const { return (this->value_) ? ((this->value_->type_ == MT_string     ) ? (static_cast<MT_Value<std::string>         *>(this->value_))->value_ : (*this->value_)) : NilValue<std::string>();          } /** @brief Returns the current value, converted to the requested type. */
     177    MultiType::operator orxonox::Vector2()     const { return (this->value_) ? ((this->value_->type_ == MT_vector2    ) ? (static_cast<MT_Value<orxonox::Vector2>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector2>();     } /** @brief Returns the current value, converted to the requested type. */
     178    MultiType::operator orxonox::Vector3()     const { return (this->value_) ? ((this->value_->type_ == MT_vector3    ) ? (static_cast<MT_Value<orxonox::Vector3>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector3>();     } /** @brief Returns the current value, converted to the requested type. */
     179    MultiType::operator orxonox::Vector4()     const { return (this->value_) ? ((this->value_->type_ == MT_vector4    ) ? (static_cast<MT_Value<orxonox::Vector4>    *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector4>();     } /** @brief Returns the current value, converted to the requested type. */
     180    MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? (static_cast<MT_Value<orxonox::ColourValue>*>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
     181    MultiType::operator orxonox::Quaternion()  const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? (static_cast<MT_Value<orxonox::Quaternion> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Quaternion>();  } /** @brief Returns the current value, converted to the requested type. */
     182    MultiType::operator orxonox::Radian()      const { return (this->value_) ? ((this->value_->type_ == MT_radian     ) ? (static_cast<MT_Value<orxonox::Radian>     *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Radian>();      } /** @brief Returns the current value, converted to the requested type. */
     183    MultiType::operator orxonox::Degree()      const { return (this->value_) ? ((this->value_->type_ == MT_degree     ) ? (static_cast<MT_Value<orxonox::Degree>     *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Degree>();      } /** @brief Returns the current value, converted to the requested type. */
    184184
    185185    template <> void MultiType::createNewValueContainer(const char& value)                 { this->value_ = new MT_Value<char>                (value, MT_char       ); } /** @brief Creates a new value container for the given type. */
  • code/trunk/src/util/MultiType.h

    r3084 r3196  
    6969#include "UtilPrereqs.h"
    7070
    71 #include <boost/static_assert.hpp>
    72 
    73 #include "Math.h"
     71#include <cassert>
     72#include <string>
     73#include <OgreVector2.h>
     74#include <OgreVector3.h>
     75#include <OgreVector4.h>
     76#include <OgreQuaternion.h>
     77#include <OgreColourValue.h>
    7478
    7579namespace orxonox
     
    441445            template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
    442446            /** @brief Creates a new value container (works only with specialized types). */
    443             template <typename T>        void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); return false; }
     447            template <typename T>        void createNewValueContainer(const T& value) { /* STATIC ASSERT */ *****value; return false; }
    444448
    445449            MT_ValueBase* value_; //!< A pointer to the value container
  • code/trunk/src/util/MultiTypeValue.h

    r3084 r3196  
    3838
    3939#include "UtilPrereqs.h"
     40
     41#include <cassert>
    4042#include "MathConvert.h"
    4143#include "MultiType.h"
    4244#include "Serialise.h"
    43 #include <cassert>
    4445
    4546namespace orxonox
     
    7576        }
    7677
    77         inline bool getValue(char*                 value) const { return ConvertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    78         inline bool getValue(unsigned char*        value) const { return ConvertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    79         inline bool getValue(short*                value) const { return ConvertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    80         inline bool getValue(unsigned short*       value) const { return ConvertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    81         inline bool getValue(int*                  value) const { return ConvertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    82         inline bool getValue(unsigned int*         value) const { return ConvertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    83         inline bool getValue(long*                 value) const { return ConvertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    84         inline bool getValue(unsigned long*        value) const { return ConvertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    85         inline bool getValue(long long*            value) const { return ConvertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    86         inline bool getValue(unsigned long long*   value) const { return ConvertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    87         inline bool getValue(float*                value) const { return ConvertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    88         inline bool getValue(double*               value) const { return ConvertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    89         inline bool getValue(long double*          value) const { return ConvertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    90         inline bool getValue(bool*                 value) const { return ConvertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    91         inline bool getValue(void**                value) const { return ConvertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    92         inline bool getValue(std::string*          value) const { return ConvertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    93         inline bool getValue(orxonox::Vector2*     value) const { return ConvertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    94         inline bool getValue(orxonox::Vector3*     value) const { return ConvertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    95         inline bool getValue(orxonox::Vector4*     value) const { return ConvertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    96         inline bool getValue(orxonox::ColourValue* value) const { return ConvertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    97         inline bool getValue(orxonox::Quaternion*  value) const { return ConvertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    98         inline bool getValue(orxonox::Radian*      value) const { return ConvertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    99         inline bool getValue(orxonox::Degree*      value) const { return ConvertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
    100 
    101         inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !ConvertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    102         inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    103         inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !ConvertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    104         inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !ConvertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    105         inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !ConvertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    106         inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !ConvertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    107         inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !ConvertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    108         inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !ConvertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    109         inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !ConvertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    110         inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !ConvertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    111         inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !ConvertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    112         inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !ConvertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    113         inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !ConvertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    114         inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !ConvertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    115         inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !ConvertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    116         inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !ConvertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    117         inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    118         inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    119         inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    120         inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !ConvertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    121         inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    122         inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    123         inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !ConvertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     78        inline bool getValue(char*                 value) const { return convertValue<T, char                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     79        inline bool getValue(unsigned char*        value) const { return convertValue<T, unsigned char       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     80        inline bool getValue(short*                value) const { return convertValue<T, short               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     81        inline bool getValue(unsigned short*       value) const { return convertValue<T, unsigned short      >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     82        inline bool getValue(int*                  value) const { return convertValue<T, int                 >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     83        inline bool getValue(unsigned int*         value) const { return convertValue<T, unsigned int        >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     84        inline bool getValue(long*                 value) const { return convertValue<T, long                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     85        inline bool getValue(unsigned long*        value) const { return convertValue<T, unsigned long       >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     86        inline bool getValue(long long*            value) const { return convertValue<T, long long           >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     87        inline bool getValue(unsigned long long*   value) const { return convertValue<T, unsigned long long  >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     88        inline bool getValue(float*                value) const { return convertValue<T, float               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     89        inline bool getValue(double*               value) const { return convertValue<T, double              >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     90        inline bool getValue(long double*          value) const { return convertValue<T, long double         >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     91        inline bool getValue(bool*                 value) const { return convertValue<T, bool                >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     92        inline bool getValue(void**                value) const { return convertValue<T, void*               >(value, value_, 0); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     93        inline bool getValue(std::string*          value) const { return convertValue<T, std::string         >(value, value_, zeroise<std::string>         ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     94        inline bool getValue(orxonox::Vector2*     value) const { return convertValue<T, orxonox::Vector2    >(value, value_, zeroise<orxonox::Vector2>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     95        inline bool getValue(orxonox::Vector3*     value) const { return convertValue<T, orxonox::Vector3    >(value, value_, zeroise<orxonox::Vector3>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     96        inline bool getValue(orxonox::Vector4*     value) const { return convertValue<T, orxonox::Vector4    >(value, value_, zeroise<orxonox::Vector4>    ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     97        inline bool getValue(orxonox::ColourValue* value) const { return convertValue<T, orxonox::ColourValue>(value, value_, zeroise<orxonox::ColourValue>()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     98        inline bool getValue(orxonox::Quaternion*  value) const { return convertValue<T, orxonox::Quaternion >(value, value_, zeroise<orxonox::Quaternion> ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     99        inline bool getValue(orxonox::Radian*      value) const { return convertValue<T, orxonox::Radian     >(value, value_, zeroise<orxonox::Radian>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     100        inline bool getValue(orxonox::Degree*      value) const { return convertValue<T, orxonox::Degree     >(value, value_, zeroise<orxonox::Degree>     ()); } /** @brief Assigns the value to the given pointer. The value gets converted if the types don't match. */
     101
     102        inline bool setValue(const char& value)                 { return !(bHasDefaultValue_ = !convertValue<char                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     103        inline bool setValue(const unsigned char& value)        { return !(bHasDefaultValue_ = !convertValue<unsigned char       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     104        inline bool setValue(const short& value)                { return !(bHasDefaultValue_ = !convertValue<short               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     105        inline bool setValue(const unsigned short& value)       { return !(bHasDefaultValue_ = !convertValue<unsigned short      , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     106        inline bool setValue(const int& value)                  { return !(bHasDefaultValue_ = !convertValue<int                 , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     107        inline bool setValue(const unsigned int& value)         { return !(bHasDefaultValue_ = !convertValue<unsigned int        , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     108        inline bool setValue(const long& value)                 { return !(bHasDefaultValue_ = !convertValue<long                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     109        inline bool setValue(const unsigned long& value)        { return !(bHasDefaultValue_ = !convertValue<unsigned long       , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     110        inline bool setValue(const long long& value)            { return !(bHasDefaultValue_ = !convertValue<long long           , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     111        inline bool setValue(const unsigned long long& value)   { return !(bHasDefaultValue_ = !convertValue<unsigned long long  , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     112        inline bool setValue(const float& value)                { return !(bHasDefaultValue_ = !convertValue<float               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     113        inline bool setValue(const double& value)               { return !(bHasDefaultValue_ = !convertValue<double              , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     114        inline bool setValue(const long double& value)          { return !(bHasDefaultValue_ = !convertValue<long double         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     115        inline bool setValue(const bool& value)                 { return !(bHasDefaultValue_ = !convertValue<bool                , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     116        inline bool setValue(      void* const& value)          { return !(bHasDefaultValue_ = !convertValue<void*               , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     117        inline bool setValue(const std::string& value)          { return !(bHasDefaultValue_ = !convertValue<std::string         , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     118        inline bool setValue(const orxonox::Vector2& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector2    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     119        inline bool setValue(const orxonox::Vector3& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector3    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     120        inline bool setValue(const orxonox::Vector4& value)     { return !(bHasDefaultValue_ = !convertValue<orxonox::Vector4    , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     121        inline bool setValue(const orxonox::ColourValue& value) { return !(bHasDefaultValue_ = !convertValue<orxonox::ColourValue, T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     122        inline bool setValue(const orxonox::Quaternion& value)  { return !(bHasDefaultValue_ = !convertValue<orxonox::Quaternion , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     123        inline bool setValue(const orxonox::Radian& value)      { return !(bHasDefaultValue_ = !convertValue<orxonox::Radian     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
     124        inline bool setValue(const orxonox::Degree& value)      { return !(bHasDefaultValue_ = !convertValue<orxonox::Degree     , T>(&value_, value, zeroise<T>())); } /** @brief Assigns the value by converting it to T. */
    124125
    125126        inline operator char()                 const { return getConvertedValue<T, char>                (this->value_, 0); }     /** @brief Returns the current value, converted to the requested type. */
     
    194195        saveAndIncrease( this->value_.z, mem );
    195196        saveAndIncrease( this->value_.w, mem );
    196     }template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
     197    }
     198    template <> inline uint8_t MT_Value<Ogre::Quaternion>::getSize() const
    197199    {
    198200        return 4*returnSize(this->value_.x);
  • code/trunk/src/util/OutputBuffer.cc

    r2710 r3196  
    4444    void OutputBuffer::registerListener(OutputBufferListener* listener)
    4545    {
    46         this->listeners_.insert(this->listeners_.end(), listener);
     46        this->listeners_.push_back(listener);
    4747    }
    4848
     
    5353    void OutputBuffer::unregisterListener(OutputBufferListener* listener)
    5454    {
    55         for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
     55        for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
    5656        {
    5757            if ((*it) == listener)
    58                 this->listeners_.erase(it++);
     58                it = this->listeners_.erase(it);
    5959            else
    6060                ++it;
     
    127127    void OutputBuffer::callListeners()
    128128    {
    129         for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     129        for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    130130            (*it)->outputChanged();
    131131    }
  • code/trunk/src/util/OutputBuffer.h

    r2171 r3196  
    4343#define _OutputBuffer_H__
    4444
    45 #include <list>
     45#include "UtilPrereqs.h"
     46
     47#include <vector>
    4648#include <sstream>
    47 #include <iostream>
    48 
    49 #include "UtilPrereqs.h"
    5049
    5150namespace orxonox
     
    167166            void callListeners();
    168167
    169             std::stringstream stream_;                   //!< The stringstream that stores the assigned text
    170             std::list<OutputBufferListener*> listeners_; //!< A list of all listeners
     168            std::stringstream stream_;                     //!< The stringstream that stores the assigned text
     169            std::vector<OutputBufferListener*> listeners_; //!< A list of all listeners
    171170    };
    172171}
  • code/trunk/src/util/OutputHandler.h

    r2710 r3196  
    6363
    6464            /** @brief Puts some text on the outstream. @param text The text */
    65             static inline std::string log(const std::string& text)
     65            static inline const std::string& log(const std::string& text)
    6666                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
    6767
    6868            /** @brief Puts an error on the outstream. @param text The text */
    69             static inline std::string error(const std::string& text)
     69            static inline const std::string& error(const std::string& text)
    7070                { OutputHandler::getOutStream().setOutputLevel(1); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7171
    7272            /** @brief Puts a warning on the outstream. @param text The text */
    73             static inline std::string warning(const std::string& text)
     73            static inline const std::string& warning(const std::string& text)
    7474                { OutputHandler::getOutStream().setOutputLevel(2); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7575
    7676            /** @brief Puts an info on the outstream. @param text The text */
    77             static inline std::string info(const std::string& text)
     77            static inline const std::string& info(const std::string& text)
    7878                { OutputHandler::getOutStream().setOutputLevel(3); OutputHandler::getOutStream().output(text + "\n"); return text; }
    7979
    8080            /** @brief Puts some debug output on the outstream. @param text The text */
    81             static inline std::string debug(const std::string& text)
     81            static inline const std::string& debug(const std::string& text)
    8282                { OutputHandler::getOutStream().setOutputLevel(4); OutputHandler::getOutStream().output(text + "\n"); return text; }
    8383
  • code/trunk/src/util/SignalHandler.cc

    r3068 r3196  
    3333
    3434#include "SignalHandler.h"
    35 #include "Debug.h"
    3635
    3736#include <iostream>
    3837#include <cstdlib>
    3938#include <cstring>
     39#include "Debug.h"
    4040
    4141namespace orxonox
     
    209209      {
    210210        if (
    211           charsFound == 0 && byte == '(' ||
    212           charsFound == 1 && byte == 'g' ||
    213           charsFound == 2 && byte == 'd' ||
    214           charsFound == 3 && byte == 'b' ||
    215           charsFound == 4 && byte == ')' ||
    216           charsFound == 5 && byte == ' '
     211          (charsFound == 0 && byte == '(') ||
     212          (charsFound == 1 && byte == 'g') ||
     213          (charsFound == 2 && byte == 'd') ||
     214          (charsFound == 3 && byte == 'b') ||
     215          (charsFound == 4 && byte == ')') ||
     216          (charsFound == 5 && byte == ' ')
    217217            )
    218218              charsFound++;
     
    246246
    247247        if (
    248           charsFound == 0 && byte == '(' ||
    249           charsFound == 1 && byte == 'g' ||
    250           charsFound == 2 && byte == 'd' ||
    251           charsFound == 3 && byte == 'b' ||
    252           charsFound == 4 && byte == ')' ||
    253           charsFound == 5 && byte == ' '
     248          (charsFound == 0 && byte == '(') ||
     249          (charsFound == 1 && byte == 'g') ||
     250          (charsFound == 2 && byte == 'd') ||
     251          (charsFound == 3 && byte == 'b') ||
     252          (charsFound == 4 && byte == ')') ||
     253          (charsFound == 5 && byte == ' ')
    254254            )
    255255              charsFound++;
  • code/trunk/src/util/Sleep.cc

    r2774 r3196  
    2828
    2929/**
    30     @file
    31     @brief Implementation of three sleep functions.
     30@file
     31@brief
     32    Implementation of three sleep functions. Avoids including windows.h
    3233*/
    3334
     
    4344    {
    4445        if (microseconds < 1000)
    45             COUT(2) << "Warning: Windows can not sleep less than 1ms, ignoring" << std::endl;
     46            COUT(2) << "Warning: Windows cannot sleep less than 1ms, ignoring" << std::endl;
    4647        Sleep(microseconds / 1000);
    4748    }
  • code/trunk/src/util/Sleep.h

    r2773 r3196  
    2828
    2929/**
    30  @file
    31  @brief
    32     Functions for using sleep() and usleep() on windows.
     30@file
     31@brief
     32    Functions declarations to make the current thread sleep.
    3333 */
    3434
     
    4040namespace orxonox
    4141{
     42    //! Makes the thread sleep for a few @a microseconds
    4243    _UtilExport void usleep(unsigned long microseconds);
     44    //! Makes the thread sleep for a few @a milliseconds
    4345    _UtilExport void msleep(unsigned long milliseconds);
     46    //! Makes the thread sleep for a few @a seconds
    4447    _UtilExport void sleep (unsigned long seconds);
    4548}
  • code/trunk/src/util/String.cc

    r2662 r3196  
    3535
    3636#include <cctype>
    37 #include <iostream>
    38 
    3937#include "Convert.h"
    4038#include "Math.h"
  • code/trunk/src/util/String.h

    r2171 r3196  
    3636
    3737#include "UtilPrereqs.h"
    38 
    3938#include <string>
    40 #include <sstream>
    4139
    4240namespace orxonox
  • code/trunk/src/util/SubString.cc

    r3089 r3196  
    3939
    4040#include "SubString.h"
    41 #include <stdio.h>
     41#include <cstdio>
    4242
    4343namespace orxonox
  • code/trunk/src/util/UtilPrereqs.h

    r2710 r3196  
    6060// Forward declarations
    6161//-----------------------------------------------------------------------
     62namespace Ogre
     63{
     64    class Radian;
     65    class Degree;
     66    class Vector2;
     67    class Vector3;
     68    class Vector4;
     69    class Matrix3;
     70    class Matrix4;
     71    class Quaternion;
     72    class ColourValue;
     73}
     74
    6275namespace orxonox
    6376{
     77    using Ogre::Radian;
     78    using Ogre::Degree;
     79    using Ogre::Vector2;
     80    using Ogre::Vector3;
     81    using Ogre::Vector4;
     82    using Ogre::Matrix3;
     83    using Ogre::Matrix4;
     84    using Ogre::Quaternion;
     85    using Ogre::ColourValue;
     86
    6487    class Exception;
    6588    class ExprParser;
  • code/trunk/src/util/mbool.h

    r2662 r3196  
    3636    struct _UtilExport mbool
    3737    {
    38 //        friend Synchronisable::registerVariable<>()
    3938        public:
    4039            inline mbool(bool value = false)
Note: See TracChangeset for help on using the changeset viewer.