assert_macros.hpp File ReferenceHandy assert macros that throw exceptions when something goes awry. More... #include <stdexcept> #include <sstream> Go to the source code of this file.
Detailed DescriptionHandy assert macros that throw exceptions when something goes awry.
These handy macros will build and throw standard exceptions that include the current file, function name, and line number. Definition in file assert_macros.hpp. Define Documentation
Value:
if(!(condition)) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #condition << " failed: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__, asrl_assert_stringstream.str()); \ } A macro to check if "condition" is true. If it isn't a runtime error is thrown.
Definition at line 94 of file assert_macros.hpp.
Value:
if(!(condition)) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #condition << " failed: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__, asrl_assert_stringstream.str()); \ } Throws a runtime error including the function, file, and line number. The exception is only thrown in debug mode.
Definition at line 259 of file assert_macros.hpp.
Value:
if(value != testValue) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " == " << #testValue << " failed [" << value << " == " << testValue << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 184 of file assert_macros.hpp.
Value:
if(value != testValue) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " == " << #testValue << " failed [" << value << " == " << testValue << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 360 of file assert_macros.hpp.
Value:
if(fabs((double)value - (double)testValue) > (double)tolerance) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " == " << #testValue << " (tolerance " << #tolerance ") failed [" << value << " != " << testValue << ", " << tolerance << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that to within some tolerance If it is not, a runtime error is thrown
Definition at line 229 of file assert_macros.hpp.
Value:
if(value < lowerBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " >= " << #lowerBound << " failed [" << value << " >= " << lowerBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 139 of file assert_macros.hpp.
Value:
if(value < lowerBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " >= " << #lowerBound << " failed [" << value << " >= " << lowerBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 309 of file assert_macros.hpp.
Value:
if(value < lowerBound || value >= upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #lowerBound << " <= " << #value << " < " << #upperBound << " failed [" << lowerBound << " <= " << value << " < " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 109 of file assert_macros.hpp.
Value:
if(value < lowerBound || value >= upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #lowerBound << " <= " << #value << " < " << #upperBound << " failed [" << lowerBound << " <= " << value << " < " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 275 of file assert_macros.hpp.
Value:
if(value <= lowerBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " > " << #lowerBound << " failed [" << value << " > " << lowerBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 169 of file assert_macros.hpp.
Value:
if(value <= lowerBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " > " << #lowerBound << " failed [" << value << " > " << lowerBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 343 of file assert_macros.hpp.
Value:
if(value > upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " <= " << #upperBound << " failed [" << value << " <= " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 154 of file assert_macros.hpp.
Value:
if(value > upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " <= " << #upperBound << " failed [" << value << " <= " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 326 of file assert_macros.hpp.
Value:
if(value >= upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " < " << #upperBound << " failed [" << value << " < " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 124 of file assert_macros.hpp.
Value:
if(value >= upperBound) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " < " << #upperBound << " failed [" << value << " < " << upperBound << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 292 of file assert_macros.hpp.
Value:
if(value == testValue) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "assert " << #value << " != " << #testValue << " failed [" << value << " != " << testValue << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown
Definition at line 199 of file assert_macros.hpp.
Value:
if(value == testValue) \ { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "debug assert " << #value << " != " << #testValue << " failed [" << value << " != " << testValue << "]: " << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } This macro asserts that If it is not, a runtime error is thrown The exception is only thrown in debug mode.
Definition at line 376 of file assert_macros.hpp.
Value:
{ \ cudaError_t err = cudaGetLastError(); \ if( cudaSuccess != err) { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "CUDA error: " << cudaGetErrorString( err ) << " : " << errorMessage; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } \ } This macro checks for a cuda error. If there is one. it throws an error
Definition at line 213 of file assert_macros.hpp.
Value:
{ \ cudaError_t err = cudaGetLastError(); \ if( cudaSuccess != err) { \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << "CUDA error: " << cudaGetErrorString( err ) << " : " << errorMessage; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__,asrl_assert_stringstream.str()); \ } \ } This macro checks for a cuda error. If there is one. it throws an error
Definition at line 391 of file assert_macros.hpp.
Value:
{ \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__, asrl_assert_stringstream.str()); \ } Throws a runtime error including the function, file, and line number.
Definition at line 81 of file assert_macros.hpp.
Value:
{ \ std::ostringstream asrl_assert_stringstream; \ asrl_assert_stringstream << message; \ asrl::detail::throw_runtime_error(__FUNCTION__,__FILE__,__LINE__, asrl_assert_stringstream.str()); \ } Throws a runtime error including the function, file, and line number. The exception is only thrown in debug mode.
Definition at line 246 of file assert_macros.hpp.
Definition at line 73 of file assert_macros.hpp. Generated on Fri Apr 30 20:06:20 2010 for gpusurf by 1.6.2 |