Added output operator for Vector2f, minor fixes.

This commit is contained in:
Felix Ableitner 2012-09-25 18:20:45 +02:00
parent 77d78b3936
commit 9a3f97b990

View file

@ -10,12 +10,14 @@
#include <iostream> #include <iostream>
#include "Vector.h"
/** /**
* Logging functions for different levels. * Logging functions for different levels.
* *
* @code * @code
* LOG_E("something bad happened"); * LOG_E("something bad happened");
* LOG_I("takeoff" << 3 << 2 << 1); * LOG_I(1 << 2 << 3 << "takeoff");
* @endcode * @endcode
*/ */
@ -23,24 +25,33 @@
* \def LOG_E(str) * \def LOG_E(str)
* Log an error to the error stream. * Log an error to the error stream.
*/ */
#define LOG_E(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Error: " << str << "\"" << std::endl #define LOG_E(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Error: " << str << std::endl
/** /**
* \def LOG_E(str) * \def LOG_E(str)
* Log a warning to the output stream. * Log a warning to the output stream.
*/ */
#define LOG_W(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Warning: " << str << "\"" << std::endl #define LOG_W(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Warning: " << str << std::endl
/** /**
* \def LOG_E(str) * \def LOG_E(str)
* Log a debug message to the output stream. * Log a debug message to the output stream.
*/ */
#define LOG_D(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Debug: " << str << "" << std::endl #define LOG_D(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Debug: " << str << std::endl
/** /**
* \def LOG_E(str) * \def LOG_E(str)
* Log an info to the output stream. * Log an info to the output stream.
*/ */
#define LOG_I(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Info: " << str << "\"" << std::endl #define LOG_I(str) std::cout << __FILE__ << ":" << __LINE__ << " " << "Info: " << str << std::endl
/**
* Adds an output operator specalization for Vector2f
*/
inline std::ostream&
operator<<(std::ostream& os, const Vector2f& vector) {
os << "(" << vector.x << ", " << vector.y << ")";
return os;
}
#endif /* DG_LOG_H_ */ #endif /* DG_LOG_H_ */