[Orxonox-commit 614] r3146 - in branches/pch/src: core util
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Jun 11 21:40:24 CEST 2009
Author: rgrieder
Date: 2009-06-11 21:40:24 +0200 (Thu, 11 Jun 2009)
New Revision: 3146
Modified:
branches/pch/src/core/BaseObject.h
branches/pch/src/core/CommandExecutor.h
branches/pch/src/util/CRC32.h
branches/pch/src/util/Clipboard.cc
branches/pch/src/util/Clipboard.h
branches/pch/src/util/Convert.h
branches/pch/src/util/Debug.h
branches/pch/src/util/ExprParser.cc
branches/pch/src/util/Math.cc
branches/pch/src/util/Math.h
branches/pch/src/util/MultiType.cc
branches/pch/src/util/MultiType.h
branches/pch/src/util/MultiTypeValue.h
branches/pch/src/util/OutputBuffer.cc
branches/pch/src/util/OutputBuffer.h
branches/pch/src/util/SignalHandler.cc
branches/pch/src/util/Sleep.cc
branches/pch/src/util/String.cc
branches/pch/src/util/String.h
branches/pch/src/util/SubString.cc
branches/pch/src/util/mbool.h
Log:
Found another few unnecessary includes in util (and added two others that followed due to this change).
Modified: branches/pch/src/core/BaseObject.h
===================================================================
--- branches/pch/src/core/BaseObject.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/core/BaseObject.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -44,6 +44,7 @@
}
#include <map>
+#include <list>
#include "CorePrereqs.h"
Modified: branches/pch/src/core/CommandExecutor.h
===================================================================
--- branches/pch/src/core/CommandExecutor.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/core/CommandExecutor.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -32,7 +32,7 @@
#include "CorePrereqs.h"
#include <map>
-
+#include <set>
#include "CommandEvaluation.h"
// tolua_begin
Modified: branches/pch/src/util/CRC32.h
===================================================================
--- branches/pch/src/util/CRC32.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/CRC32.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -30,7 +30,6 @@
#define _Util_CRC_H__
#include "UtilPrereqs.h"
-#include <iostream>
namespace orxonox
{
Modified: branches/pch/src/util/Clipboard.cc
===================================================================
--- branches/pch/src/util/Clipboard.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Clipboard.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -111,7 +111,7 @@
namespace orxonox
{
- std::string clipboard = ""; //!< Keeps the text of our internal clipboard
+ static std::string clipboard = ""; //!< Keeps the text of our internal clipboard
/**
@brief Default implementation if there is no OS-specific implementation or no clipboard. Copies the text into an internal clipboard.
@@ -128,7 +128,7 @@
@brief Default implementation if there is no OS-specific implementation or no clipboard. Gets the text from the internal clipboard.
@return The text
*/
- std::string fromClipboard()
+ const std::string& fromClipboard()
{
return clipboard;
}
Modified: branches/pch/src/util/Clipboard.h
===================================================================
--- branches/pch/src/util/Clipboard.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Clipboard.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -42,7 +42,6 @@
#define _Clipboard_H__
#include "UtilPrereqs.h"
-
#include <string>
namespace orxonox
Modified: branches/pch/src/util/Convert.h
===================================================================
--- branches/pch/src/util/Convert.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Convert.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -39,8 +39,6 @@
#include <string>
#include <sstream>
-#include <istream>
-#include <ostream>
#include <typeinfo>
#include "Debug.h"
Modified: branches/pch/src/util/Debug.h
===================================================================
--- branches/pch/src/util/Debug.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Debug.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -62,8 +62,6 @@
#include "UtilPrereqs.h"
-#include <stdio.h>
-
#include "OutputHandler.h"
namespace orxonox
@@ -72,7 +70,7 @@
@brief Returns the soft debug level, stored in the only existing instance of the OutputHandler class, configured in the config-file.
@return The soft debug level
*/
- static inline int getSoftDebugLevel()
+ inline int getSoftDebugLevel()
{
return OutputHandler::getSoftDebugLevel();
}
Modified: branches/pch/src/util/ExprParser.cc
===================================================================
--- branches/pch/src/util/ExprParser.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/ExprParser.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -34,7 +34,7 @@
#include "ExprParser.h"
#include <cmath>
#include <cstring>
-#include <stdlib.h>
+#include <cstdlib>
// macros for easier if, else statements
#define CASE_1(var) if (!strcmp(SWITCH,var))
Modified: branches/pch/src/util/Math.cc
===================================================================
--- branches/pch/src/util/Math.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Math.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -34,10 +34,10 @@
#include "Math.h"
#include <OgrePlane.h>
+
#include "MathConvert.h"
#include "SubString.h"
-
-// Do not remove this include to avoid linker errors.
+// Do not remove this include, it avoids linker errors.
#include "mbool.h"
namespace orxonox
Modified: branches/pch/src/util/Math.h
===================================================================
--- branches/pch/src/util/Math.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Math.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -36,17 +36,13 @@
#include "UtilPrereqs.h"
-#include <ostream>
#include <string>
#include <cmath>
-#include <boost/static_assert.hpp>
#include <OgreMath.h>
#include <OgreVector2.h>
#include <OgreVector3.h>
#include <OgreVector4.h>
-#include <OgreMatrix3.h>
-#include <OgreMatrix4.h>
#include <OgreQuaternion.h>
#include <OgreColourValue.h>
@@ -206,6 +202,19 @@
template <> inline orxonox::ColourValue zeroise<orxonox::ColourValue>() { return orxonox::ColourValue(0, 0, 0, 0); }
template <> inline orxonox::Quaternion zeroise<orxonox::Quaternion>() { return orxonox::Quaternion (0, 0, 0, 0); }
+ //! Provides zero value symbols that can be returned as reference
+ template <typename T>
+ struct NilValue
+ {
+ inline operator const T&() const
+ {
+ return value;
+ }
+ static T value;
+ };
+ template <typename T>
+ T NilValue<T>::value = zeroise<T>();
+
/**
@brief Interpolates between two values for a time between 0 and 1.
@param time The time is a value between 0 and 1 - the function returns start if time is 0 and end if time is 1 and interpolates if time is between 0 and 1.
@@ -214,7 +223,7 @@
@return The interpolation at a given time
*/
template <typename T>
- T interpolate(float time, const T& start, const T& end)
+ inline T interpolate(float time, const T& start, const T& end)
{
return time * (end - start) + start;
}
@@ -227,7 +236,7 @@
@return The smoothed interpolation at a given time
*/
template <typename T>
- T interpolateSmooth(float time, const T& start, const T& end)
+ inline T interpolateSmooth(float time, const T& start, const T& end)
{
return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;
}
@@ -272,20 +281,20 @@
class IntVector2
{
public:
- IntVector2() : x(0), y(0) { }
- IntVector2(int _x, int _y) : x(_x), y(_y) { }
- int x;
- int y;
+ IntVector2() : x(0), y(0) { }
+ IntVector2(int _x, int _y) : x(_x), y(_y) { }
+ int x;
+ int y;
};
class IntVector3
{
public:
- IntVector3() : x(0), y(0), z(0) { }
- IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
- int x;
- int y;
- int z;
+ IntVector3() : x(0), y(0), z(0) { }
+ IntVector3(int _x, int _y, int _z) : x(_x), y(_y), z(_z) { }
+ int x;
+ int y;
+ int z;
};
}
Modified: branches/pch/src/util/MultiType.cc
===================================================================
--- branches/pch/src/util/MultiType.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/MultiType.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -158,29 +158,29 @@
};
}
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
- 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
+ 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. */
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. */
template <> void MultiType::createNewValueContainer(const unsigned char& value) { this->value_ = new MT_Value<unsigned char> (value, MT_uchar ); } /** @brief Creates a new value container for the given type. */
Modified: branches/pch/src/util/MultiType.h
===================================================================
--- branches/pch/src/util/MultiType.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/MultiType.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -68,10 +68,14 @@
#include "UtilPrereqs.h"
-#include <boost/static_assert.hpp>
+#include <cassert>
+#include <string>
+#include <OgreVector2.h>
+#include <OgreVector3.h>
+#include <OgreVector4.h>
+#include <OgreQuaternion.h>
+#include <OgreColourValue.h>
-#include "Math.h"
-
namespace orxonox
{
/**
@@ -440,7 +444,7 @@
/** @brief Changes the value container. */
template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
/** @brief Creates a new value container (works only with specialized types). */
- template <typename T> void createNewValueContainer(const T& value) { BOOST_STATIC_ASSERT(sizeof(T) == 0); return false; }
+ template <typename T> void createNewValueContainer(const T& value) { /* STATIC ASSERT */ *****value; return false; }
MT_ValueBase* value_; //!< A pointer to the value container
};
Modified: branches/pch/src/util/MultiTypeValue.h
===================================================================
--- branches/pch/src/util/MultiTypeValue.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/MultiTypeValue.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -37,10 +37,11 @@
#define _MultiTypeValue_H__
#include "UtilPrereqs.h"
+
+#include <cassert>
#include "MathConvert.h"
#include "MultiType.h"
#include "Serialise.h"
-#include <cassert>
namespace orxonox
{
Modified: branches/pch/src/util/OutputBuffer.cc
===================================================================
--- branches/pch/src/util/OutputBuffer.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/OutputBuffer.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -43,7 +43,7 @@
*/
void OutputBuffer::registerListener(OutputBufferListener* listener)
{
- this->listeners_.insert(this->listeners_.end(), listener);
+ this->listeners_.push_back(listener);
}
/**
@@ -52,10 +52,10 @@
*/
void OutputBuffer::unregisterListener(OutputBufferListener* listener)
{
- for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
+ for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
{
if ((*it) == listener)
- this->listeners_.erase(it++);
+ it = this->listeners_.erase(it);
else
++it;
}
@@ -126,7 +126,7 @@
*/
void OutputBuffer::callListeners()
{
- for (std::list<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
+ for (std::vector<OutputBufferListener*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
(*it)->outputChanged();
}
}
Modified: branches/pch/src/util/OutputBuffer.h
===================================================================
--- branches/pch/src/util/OutputBuffer.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/OutputBuffer.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -42,12 +42,11 @@
#ifndef _OutputBuffer_H__
#define _OutputBuffer_H__
-#include <list>
-#include <sstream>
-#include <iostream>
-
#include "UtilPrereqs.h"
+#include <vector>
+#include <sstream>
+
namespace orxonox
{
/**
@@ -166,8 +165,8 @@
private:
void callListeners();
- std::stringstream stream_; //!< The stringstream that stores the assigned text
- std::list<OutputBufferListener*> listeners_; //!< A list of all listeners
+ std::stringstream stream_; //!< The stringstream that stores the assigned text
+ std::vector<OutputBufferListener*> listeners_; //!< A list of all listeners
};
}
Modified: branches/pch/src/util/SignalHandler.cc
===================================================================
--- branches/pch/src/util/SignalHandler.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/SignalHandler.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -32,11 +32,11 @@
*/
#include "SignalHandler.h"
-#include "Debug.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
+#include "Debug.h"
namespace orxonox
{
Modified: branches/pch/src/util/Sleep.cc
===================================================================
--- branches/pch/src/util/Sleep.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/Sleep.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -42,7 +42,7 @@
void usleep(unsigned long microseconds)
{
if (microseconds < 1000)
- COUT(2) << "Warning: Windows can not sleep less than 1ms, ignoring" << std::endl;
+ COUT(2) << "Warning: Windows cannot sleep less than 1ms, ignoring" << std::endl;
Sleep(microseconds / 1000);
}
Modified: branches/pch/src/util/String.cc
===================================================================
--- branches/pch/src/util/String.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/String.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -34,8 +34,6 @@
#include "String.h"
#include <cctype>
-#include <iostream>
-
#include "Convert.h"
#include "Math.h"
Modified: branches/pch/src/util/String.h
===================================================================
--- branches/pch/src/util/String.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/String.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -35,9 +35,7 @@
#define _Util_String_H__
#include "UtilPrereqs.h"
-
#include <string>
-#include <sstream>
namespace orxonox
{
Modified: branches/pch/src/util/SubString.cc
===================================================================
--- branches/pch/src/util/SubString.cc 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/SubString.cc 2009-06-11 19:40:24 UTC (rev 3146)
@@ -38,7 +38,7 @@
*/
#include "SubString.h"
-#include <stdio.h>
+#include <cstdio>
namespace orxonox
{
Modified: branches/pch/src/util/mbool.h
===================================================================
--- branches/pch/src/util/mbool.h 2009-06-11 16:22:15 UTC (rev 3145)
+++ branches/pch/src/util/mbool.h 2009-06-11 19:40:24 UTC (rev 3146)
@@ -35,7 +35,6 @@
{
struct _UtilExport mbool
{
-// friend Synchronisable::registerVariable<>()
public:
inline mbool(bool value = false)
{ this->value_.memory_ = 0; this->value_.bool_ = value; }
More information about the Orxonox-commit
mailing list