Changeset 7266 for code/trunk/src
- Timestamp:
- Aug 30, 2010, 5:04:12 PM (14 years ago)
- Location:
- code/trunk/src
- Files:
-
- 8 added
- 16 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/CMakeLists.txt
r5781 r7266 34 34 ADD_SUBDIRECTORY(bullet) 35 35 ADD_SUBDIRECTORY(cpptcl) 36 ADD_SUBDIRECTORY(loki) 36 37 ADD_SUBDIRECTORY(ogreceguirenderer) 37 38 ADD_SUBDIRECTORY(ois) -
code/trunk/src/external/loki/ScopeGuard.h
r7263 r7266 12 12 // suitability of this software for any purpose. It is provided "as is" 13 13 // without express or implied warranty. 14 // 15 // Changes by Orxonox (Reto Grieder) 16 // Moved one protected variable to the public section to allow the use of 17 // the ScopeGuard in a class definition. 14 18 //////////////////////////////////////////////////////////////////////////////// 15 19 #ifndef LOKI_SCOPEGUARD_INC_ … … 19 23 20 24 21 #include "RefToValue.h"25 #include <loki/RefToValue.h> 22 26 23 27 /// \defgroup ExceptionGroup Exception-safe code -
code/trunk/src/external/loki/TypeTraits.h
r7263 r7266 3 3 // Copyright (c) 2001 by Andrei Alexandrescu 4 4 // This code accompanies the book: 5 // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design 5 // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design 6 6 // Patterns Applied". Copyright (c) 2001. Addison-Wesley. 7 // Permission to use, copy, modify, distribute and sell this software for any 8 // purpose is hereby granted without fee, provided that the above copyright 9 // notice appear in all copies and that both that copyright notice and this 7 // Permission to use, copy, modify, distribute and sell this software for any 8 // purpose is hereby granted without fee, provided that the above copyright 9 // notice appear in all copies and that both that copyright notice and this 10 10 // permission notice appear in supporting documentation. 11 // The author or Addison-Wesley Longman make no representations about the 12 // suitability of this software for any purpose. It is provided "as is" 11 // The author or Addison-Wesley Longman make no representations about the 12 // suitability of this software for any purpose. It is provided "as is" 13 13 // without express or implied warranty. 14 14 // 15 // Changes by Orxonox (Reto )15 // Changes by Orxonox (Reto Grieder) 16 16 // Removed all stdInt, etc. type traits and function pointer traits 17 17 // and added UnqualifiedReferredType. … … 20 20 #define LOKI_TYPETRAITS_INC_ 21 21 22 // $Id: TypeTraits.h 835 2007-08-02 19:39:02Z syntheticpp $ 23 22 // $Id: TypeTraits.h 1069 2010-04-19 03:09:59Z rich_sposato $ 23 24 25 #include <loki/NullType.h> 24 26 25 27 #if (defined _MSC_VER) && (_MSC_VER < 1400) … … 29 31 30 32 #ifdef _MSC_VER 31 #pragma warning( push ) 33 #pragma warning( push ) 32 34 #pragma warning( disable : 4180 ) //qualifier applied to function type has no meaning; ignored 33 35 #endif … … 36 38 { 37 39 //////////////////////////////////////////////////////////////////////////////// 38 // class NullType39 // Used as a placeholder for "no type here"40 // Useful as an end marker in typelists41 ////////////////////////////////////////////////////////////////////////////////42 43 class NullType {};44 45 ////////////////////////////////////////////////////////////////////////////////46 40 // class template IsCustomUnsignedInt 47 41 // Offers a means to integrate nonstandard built-in unsigned integral types 48 // (such as unsigned __int64 or unsigned long long int) with the TypeTraits 42 // (such as unsigned __int64 or unsigned long long int) with the TypeTraits 49 43 // class template defined below. 50 44 // Invocation: IsCustomUnsignedInt<T> where T is any type … … 59 53 { 60 54 enum { value = 0 }; 61 }; 55 }; 62 56 63 57 //////////////////////////////////////////////////////////////////////////////// 64 58 // class template IsCustomSignedInt 65 59 // Offers a means to integrate nonstandard built-in unsigned integral types 66 // (such as unsigned __int64 or unsigned long long int) with the TypeTraits 60 // (such as unsigned __int64 or unsigned long long int) with the TypeTraits 67 61 // class template defined below. 68 62 // Invocation: IsCustomSignedInt<T> where T is any type … … 77 71 { 78 72 enum { value = 0 }; 79 }; 73 }; 80 74 81 75 //////////////////////////////////////////////////////////////////////////////// … … 94 88 { 95 89 enum { value = 0 }; 96 }; 90 }; 97 91 98 92 //////////////////////////////////////////////////////////////////////////////// … … 142 136 }; 143 137 }// namespace Private 144 138 145 139 //////////////////////////////////////////////////////////////////////////////// 146 140 // class template TypeTraits … … 150 144 // 151 145 // - isPointer : returns true if T is a pointer type 152 // - PointeeType : returns the type to which T points if T is a pointer 146 // - PointeeType : returns the type to which T points if T is a pointer 153 147 // type, NullType otherwise 154 148 // - isReference : returns true if T is a reference type 155 // - ReferredType : returns the type to which T refers if T is a reference 149 // - ReferredType : returns the type to which T refers if T is a reference 156 150 // type, NullType otherwise 157 // - ParameterType : returns the optimal type to be used as a parameter for 151 // - ParameterType : returns the optimal type to be used as a parameter for 158 152 // functions that take Ts 159 153 // - isConst : returns true if T is a const-qualified type … … 161 155 // - isVolatile : returns true if T is a volatile-qualified type 162 156 // - NonVolatileType : Type with removed 'volatile' qualifier from T, if any 163 // - UnqualifiedType : Type with removed 'const' and 'volatile' qualifiers from 157 // - UnqualifiedType : Type with removed 'const' and 'volatile' qualifiers from 164 158 // T, if any 165 // - ParameterType : returns the optimal type to be used as a parameter 159 // - ParameterType : returns the optimal type to be used as a parameter 166 160 // for functions that take 'const T's 167 161 // … … 172 166 { 173 167 private: 174 168 175 169 template <class U> struct ReferenceTraits 176 170 { … … 178 172 typedef U ReferredType; 179 173 }; 180 174 181 175 template <class U> struct ReferenceTraits<U&> 182 176 { … … 184 178 typedef U ReferredType; 185 179 }; 186 180 187 181 template <class U> struct PointerTraits 188 182 { … … 190 184 typedef NullType PointeeType; 191 185 }; 192 186 193 187 template <class U> struct PointerTraits<U*> 194 188 { … … 196 190 typedef U PointeeType; 197 191 }; 198 192 199 193 template <class U> struct PointerTraits<U*&> 200 194 { … … 202 196 typedef U PointeeType; 203 197 }; 204 198 205 199 template <class U> struct PToMTraits 206 200 { 207 201 enum { result = false }; 208 202 }; 209 203 210 204 template <class U, class V> struct PToMTraits<U V::*> 211 205 { 212 206 enum { result = true }; 213 207 }; 214 208 215 209 template <class U, class V> struct PToMTraits<U V::*&> 216 210 { 217 211 enum { result = true }; 218 212 }; 219 213 220 214 template <class U> struct UnConst 221 215 { … … 223 217 enum { isConst = 0 }; 224 218 }; 225 219 226 220 template <class U> struct UnConst<const U> 227 221 { … … 235 229 enum { isConst = 1 }; 236 230 }; 237 231 238 232 template <class U> struct UnVolatile 239 233 { … … 241 235 enum { isVolatile = 0 }; 242 236 }; 243 237 244 238 template <class U> struct UnVolatile<volatile U> 245 239 { … … 253 247 enum { isVolatile = 1 }; 254 248 }; 255 249 256 250 public: 257 typedef typename UnConst<T>::Result 251 typedef typename UnConst<T>::Result 258 252 NonConstType; 259 typedef typename UnVolatile<T>::Result 253 typedef typename UnVolatile<T>::Result 260 254 NonVolatileType; 261 typedef typename UnVolatile<typename UnConst<T>::Result>::Result 255 typedef typename UnVolatile<typename UnConst<T>::Result>::Result 262 256 UnqualifiedType; 263 typedef typename PointerTraits<UnqualifiedType>::PointeeType 257 typedef typename PointerTraits<UnqualifiedType>::PointeeType 264 258 PointeeType; 265 typedef typename ReferenceTraits<T>::ReferredType 259 typedef typename ReferenceTraits<T>::ReferredType 266 260 ReferredType; 267 261 typedef typename ReferenceTraits<typename UnVolatile<typename UnConst<T>::Result>::Result>::ReferredType … … 273 267 enum { isPointer = PointerTraits< 274 268 typename ReferenceTraits<UnqualifiedType>::ReferredType >::result}; 275 269 276 270 }; 277 271 } -
code/trunk/src/libraries/core/Core.h
r6746 r7266 36 36 #include <string> 37 37 #include <boost/scoped_ptr.hpp> 38 #include "util/ScopeGuard.h" 38 #include <loki/ScopeGuard.h> 39 39 40 #include "util/Singleton.h" 40 41 #include "OrxonoxClass.h" -
code/trunk/src/libraries/core/CorePrecompiledHeaders.h
r5781 r7266 57 57 #include <cmath> // 42 58 58 59 #include "util/ScopeGuard.h"// 3859 #include <loki/ScopeGuard.h> // 38 60 60 61 61 #include <OgreMath.h> // 36 -
code/trunk/src/libraries/core/Game.cc
r6502 r7266 37 37 #include <exception> 38 38 #include <boost/weak_ptr.hpp> 39 #include <loki/ScopeGuard.h> 39 40 40 41 #include "util/Clock.h" 41 42 #include "util/Debug.h" 42 43 #include "util/Exception.h" 43 #include "util/ScopeGuard.h"44 44 #include "util/Sleep.h" 45 45 #include "util/SubString.h" -
code/trunk/src/libraries/core/Game.h
r6746 r7266 46 46 #include <boost/scoped_ptr.hpp> 47 47 #include <boost/preprocessor/cat.hpp> 48 #include <loki/ScopeGuard.h> 48 49 49 50 #include "util/Debug.h" 50 #include "util/ScopeGuard.h"51 51 #include "util/Singleton.h" 52 52 #include "OrxonoxClass.h" -
code/trunk/src/libraries/core/Identifier.h
r6536 r7266 57 57 #include <string> 58 58 #include <typeinfo> 59 #include <loki/TypeTraits.h> 59 60 60 61 #include "util/Debug.h" 61 #include "util/TypeTraits.h"62 62 #include "MetaObjectList.h" 63 63 #include "ObjectList.h" -
code/trunk/src/libraries/core/LuaState.cc
r6763 r7266 35 35 #include <lualib.h> 36 36 } 37 #include <loki/ScopeGuard.h> 37 38 38 39 #include "util/Debug.h" 39 40 #include "util/Exception.h" 40 #include "util/ScopeGuard.h"41 41 #include "IOConsole.h" 42 42 #include "Resource.h" -
code/trunk/src/libraries/core/LuaState.h
r6763 r7266 38 38 #include <vector> 39 39 #include <boost/shared_ptr.hpp> 40 #include <loki/ScopeGuard.h> 40 41 41 #include "util/ScopeGuard.h"42 42 #include "Functor.h" 43 43 #include "ToluaInterface.h" -
code/trunk/src/libraries/core/input/InputManager.cc
r7174 r7266 40 40 #include <ois/OISInputManager.h> 41 41 #include <boost/foreach.hpp> 42 #include <loki/ScopeGuard.h> 42 43 43 44 #include "util/Clock.h" 44 45 #include "util/Convert.h" 45 46 #include "util/Exception.h" 46 #include "util/ScopeGuard.h"47 47 #include "core/CoreIncludes.h" 48 48 #include "core/ConfigValueIncludes.h" -
code/trunk/src/libraries/network/NetworkPrecompiledHeaders.h
r5781 r7266 53 53 54 54 #include "util/Debug.h" // 20 55 #include "util/TypeTraits.h"// 1855 #include <loki/TypeTraits.h> // 18 56 56 57 57 #ifdef ORXONOX_COMPILER_MSVC -
code/trunk/src/libraries/network/synchronisable/Serialise.h
r7163 r7266 35 35 #define _NetworkSerialise_H__ 36 36 37 #include "network/NetworkPrereqs.h" 38 39 #include <loki/TypeTraits.h> 40 37 41 #include "util/Serialise.h" 38 #include "util/TypeTraits.h"39 42 #include "core/CorePrereqs.h" 40 43 #include "core/CoreIncludes.h" -
code/trunk/src/libraries/network/synchronisable/SynchronisableVariable.h
r6417 r7266 35 35 #include <cassert> 36 36 #include <cstring> 37 #include <loki/TypeTraits.h> 38 37 39 #include "Serialise.h" 38 #include "util/TypeTraits.h"39 40 #include "core/GameMode.h" 40 41 #include "network/synchronisable/NetworkCallbackManager.h" -
code/trunk/src/libraries/util/Convert.h
r7163 r7266 41 41 #include <sstream> 42 42 #include <typeinfo> 43 #include <loki/TypeManip.h> 43 44 44 45 #include "Debug.h" … … 76 77 namespace orxonox 77 78 { 78 namespace detail79 {80 //! Little template that maps integers to entire types (Alexandrescu 2001)81 template <int I>82 struct Int2Type { };83 }84 85 86 79 /////////////////// 87 80 // No Conversion // … … 215 208 // implicit cast not possible, try stringstream conversion next 216 209 template <class FromType, class ToType> 217 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<false>)210 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>) 218 211 { 219 212 return ConverterStringStream<FromType, ToType>::convert(output, input); … … 222 215 // We can cast implicitely 223 216 template <class FromType, class ToType> 224 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, detail::Int2Type<true>)217 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>) 225 218 { 226 219 (*output) = static_cast<ToType>(input); … … 242 235 // Try implict cast and probe first. If a simple cast is not possible, it will not compile 243 236 // We therefore have to out source it into another template function 244 return convertImplicitely(output, input, detail::Int2Type<probe>());237 return convertImplicitely(output, input, Loki::Int2Type<probe>()); 245 238 } 246 239 }; -
code/trunk/src/libraries/util/MultiType.h
r7165 r7266 76 76 #include <OgreQuaternion.h> 77 77 #include <OgreColourValue.h> 78 79 #include "TypeTraits.h" 78 #include <loki/TypeTraits.h> 80 79 81 80 namespace orxonox -
code/trunk/src/libraries/util/Scope.h
r5929 r7266 35 35 #include <map> 36 36 #include <set> 37 #include <loki/ScopeGuard.h> 37 38 38 39 #include "Debug.h" 39 #include "ScopeGuard.h"40 40 41 41 namespace orxonox -
code/trunk/src/orxonox/sound/SoundManager.cc
r7174 r7266 33 33 #include <AL/alut.h> 34 34 #include <utility> 35 #include <loki/ScopeGuard.h> 35 36 36 37 #include "util/Exception.h" 37 38 #include "util/Math.h" 38 #include "util/ScopeGuard.h"39 39 #include "util/Clock.h" 40 40 #include "core/ConfigValueIncludes.h"
Note: See TracChangeset
for help on using the changeset viewer.