Changeset 8284 for code/branches/kicklib2/src/libraries/util
- Timestamp:
- Apr 21, 2011, 6:58:23 PM (14 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
- Property svn:mergeinfo changed
-
code/branches/kicklib2/src/libraries/util/Convert.h
r7401 r8284 143 143 struct ConverterFallback 144 144 { 145 FORCEINLINE static bool convert(ToType* output, const FromType& input)145 ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input) 146 146 { 147 147 COUT(2) << "Could not convert value of type " << typeid(FromType).name() … … 155 155 struct ConverterFallback<FromType*, ToType*> 156 156 { 157 FORCEINLINE static bool convert(ToType** output, FromType* const input)157 ORX_FORCEINLINE static bool convert(ToType** output, FromType* const input) 158 158 { 159 159 ToType* temp = dynamic_cast<ToType*>(input); … … 182 182 struct ConverterStringStream 183 183 { 184 FORCEINLINE static bool convert(ToType* output, const FromType& input)184 ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input) 185 185 { 186 186 return orxonox::ConverterFallback<FromType, ToType>::convert(output, input); … … 198 198 /// Fallback operator <<() (delegates to orxonox::ConverterFallback) 199 199 template <class FromType> 200 FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input)200 ORX_FORCEINLINE bool operator <<(std::ostream& outstream, const FromType& input) 201 201 { 202 202 std::string temp; … … 215 215 struct ConverterStringStream<FromType, std::string> 216 216 { 217 FORCEINLINE static bool convert(std::string* output, const FromType& input)217 ORX_FORCEINLINE static bool convert(std::string* output, const FromType& input) 218 218 { 219 219 using namespace fallbackTemplates; … … 241 241 /// Fallback operator >>() (delegates to orxonox::ConverterFallback) 242 242 template <class ToType> 243 FORCEINLINE bool operator >>(std::istream& instream, ToType& output)243 ORX_FORCEINLINE bool operator >>(std::istream& instream, ToType& output) 244 244 { 245 245 std::string input(static_cast<std::istringstream&>(instream).str()); … … 252 252 struct ConverterStringStream<std::string, ToType> 253 253 { 254 FORCEINLINE static bool convert(ToType* output, const std::string& input)254 ORX_FORCEINLINE static bool convert(ToType* output, const std::string& input) 255 255 { 256 256 using namespace fallbackTemplates; … … 276 276 /// %Template delegates to ::ConverterStringStream 277 277 template <class FromType, class ToType> 278 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>)278 ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<false>) 279 279 { 280 280 return ConverterStringStream<FromType, ToType>::convert(output, input); … … 283 283 /// Makes an implicit cast from \a FromType to \a ToType 284 284 template <class FromType, class ToType> 285 FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>)285 ORX_FORCEINLINE bool convertImplicitely(ToType* output, const FromType& input, Loki::Int2Type<true>) 286 286 { 287 287 (*output) = static_cast<ToType>(input); … … 303 303 { 304 304 enum { probe = ImplicitConversion<FromType, ToType>::exists }; 305 FORCEINLINE static bool convert(ToType* output, const FromType& input)305 ORX_FORCEINLINE static bool convert(ToType* output, const FromType& input) 306 306 { 307 307 // Use the probe's value to delegate to the right function … … 327 327 */ 328 328 template <class FromType, class ToType> 329 FORCEINLINE bool convertValue(ToType* output, const FromType& input)329 ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input) 330 330 { 331 331 return ConverterExplicit<FromType, ToType>::convert(output, input); … … 348 348 */ 349 349 template<class FromType, class ToType> 350 FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback)350 ORX_FORCEINLINE bool convertValue(ToType* output, const FromType& input, const ToType& fallback) 351 351 { 352 352 if (convertValue(output, input)) … … 361 361 /// Directly returns the converted value, but uses the fallback on failure. @see convertValue 362 362 template<class FromType, class ToType> 363 FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback)363 ORX_FORCEINLINE ToType getConvertedValue(const FromType& input, const ToType& fallback) 364 364 { 365 365 ToType output; … … 380 380 */ 381 381 template<class ToType, class FromType> 382 FORCEINLINE ToType multi_cast(const FromType& input)382 ORX_FORCEINLINE ToType multi_cast(const FromType& input) 383 383 { 384 384 ToType output; … … 395 395 struct ConverterExplicit<const char*, ToType> 396 396 { 397 FORCEINLINE static bool convert(ToType* output, const char* input)397 ORX_FORCEINLINE static bool convert(ToType* output, const char* input) 398 398 { 399 399 return convertValue<std::string, ToType>(output, input); … … 405 405 struct ConverterExplicit<char, std::string> 406 406 { 407 FORCEINLINE static bool convert(std::string* output, const char input)407 ORX_FORCEINLINE static bool convert(std::string* output, const char input) 408 408 { 409 409 *output = input; … … 415 415 struct ConverterExplicit<unsigned char, std::string> 416 416 { 417 FORCEINLINE static bool convert(std::string* output, const unsigned char input)417 ORX_FORCEINLINE static bool convert(std::string* output, const unsigned char input) 418 418 { 419 419 *output = input; … … 425 425 struct ConverterExplicit<std::string, char> 426 426 { 427 FORCEINLINE static bool convert(char* output, const std::string& input)427 ORX_FORCEINLINE static bool convert(char* output, const std::string& input) 428 428 { 429 429 if (!input.empty()) … … 438 438 struct ConverterExplicit<std::string, unsigned char> 439 439 { 440 FORCEINLINE static bool convert(unsigned char* output, const std::string& input)440 ORX_FORCEINLINE static bool convert(unsigned char* output, const std::string& input) 441 441 { 442 442 if (!input.empty()) … … 453 453 struct ConverterExplicit<bool, std::string> 454 454 { 455 FORCEINLINE static bool convert(std::string* output, const bool& input)455 ORX_FORCEINLINE static bool convert(std::string* output, const bool& input) 456 456 { 457 457 if (input) -
code/branches/kicklib2/src/libraries/util/MathConvert.h
r7401 r8284 51 51 struct ConverterExplicit<orxonox::Vector2, std::string> 52 52 { 53 FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input)53 ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector2& input) 54 54 { 55 55 std::ostringstream ostream; … … 67 67 struct ConverterExplicit<orxonox::Vector3, std::string> 68 68 { 69 FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input)69 ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector3& input) 70 70 { 71 71 std::ostringstream ostream; … … 83 83 struct ConverterExplicit<orxonox::Vector4, std::string> 84 84 { 85 FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input)85 ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Vector4& input) 86 86 { 87 87 std::ostringstream ostream; … … 99 99 struct ConverterExplicit<orxonox::Quaternion, std::string> 100 100 { 101 FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input)101 ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::Quaternion& input) 102 102 { 103 103 std::ostringstream ostream; … … 115 115 struct ConverterExplicit<orxonox::ColourValue, std::string> 116 116 { 117 FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input)117 ORX_FORCEINLINE static bool convert(std::string* output, const orxonox::ColourValue& input) 118 118 { 119 119 std::ostringstream ostream; … … 157 157 struct ConverterFallback<orxonox::Radian, ToType> 158 158 { 159 FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input)159 ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Radian& input) 160 160 { 161 161 return convertValue<Ogre::Real, ToType>(output, input.valueRadians()); … … 167 167 struct ConverterFallback<orxonox::Degree, ToType> 168 168 { 169 FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input)169 ORX_FORCEINLINE static bool convert(ToType* output, const orxonox::Degree& input) 170 170 { 171 171 return convertValue<Ogre::Real, ToType>(output, input.valueDegrees()); … … 177 177 struct ConverterFallback<FromType, orxonox::Radian> 178 178 { 179 FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input)179 ORX_FORCEINLINE static bool convert(orxonox::Radian* output, const FromType& input) 180 180 { 181 181 float temp; … … 194 194 struct ConverterFallback<FromType, orxonox::Degree> 195 195 { 196 FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input)196 ORX_FORCEINLINE static bool convert(orxonox::Degree* output, const FromType& input) 197 197 { 198 198 float temp; -
code/branches/kicklib2/src/libraries/util/SharedPtr.h
r7401 r8284 163 163 public: 164 164 SharedCounter() : count_(1) {} 165 virtual ~SharedCounter() {} 165 166 virtual void destroy() = 0; 166 167 … … 186 187 _UtilExport SmallObjectAllocator& createSharedCounterPool(); 187 188 188 FORCEINLINE SmallObjectAllocator& getSharedCounterPool()189 ORX_FORCEINLINE SmallObjectAllocator& getSharedCounterPool() 189 190 { 190 191 static SmallObjectAllocator& instance = createSharedCounterPool(); -
code/branches/kicklib2/src/libraries/util/SignalHandler.h
r7457 r8284 70 70 71 71 /// The SignalHandler is used to catch signals like SIGSEGV and write a backtrace to the logfile. 72 class SignalHandler : public Singleton<SignalHandler>72 class _UtilExport SignalHandler : public Singleton<SignalHandler> 73 73 { 74 74 friend class Singleton<SignalHandler>; -
code/branches/kicklib2/src/libraries/util/UtilPrereqs.h
r6417 r8284 52 52 # endif 53 53 # endif 54 #elif defined ( ORXONOX_GCC_VISIBILITY ) 54 # define _UtilPrivate 55 #elif defined (ORXONOX_GCC_VISIBILITY) 55 56 # define _UtilExport __attribute__ ((visibility("default"))) 57 # define _UtilPrivate __attribute__ ((visibility("hidden"))) 56 58 #else 57 59 # define _UtilExport 60 # define _UtilPrivate 58 61 #endif 59 62
Note: See TracChangeset
for help on using the changeset viewer.