00001 #ifndef SYNAPS_UTIL_DEBUG_UTIL_H
00002 #define SYNAPS_UTIL_DEBUG_UTIL_H
00003
00004 #include <iostream>
00005 #include <string>
00006 #include <synaps/init.h>
00007
00008
00009 __BEGIN_NAMESPACE_SYNAPS
00010 #define debug_value(x) std::cout << #x << " = " << x << std::endl
00011 namespace DEBUG {
00012
00013 inline
00014 void print(const std::string& msg)
00015 {
00016 #if DEBUG_OUTPUT
00017 std::cout << msg << std::endl;
00018 #endif
00019 return;
00020 }
00021
00022 template < typename T > inline
00023 void print(const std::string& msg, const T& val)
00024 {
00025 #if DEBUG_OUTPUT
00026 std::cout << msg << " = " << val << std::endl;
00027 #endif
00028 return;
00029 }
00030
00031
00032 }
00033 __END_NAMESPACE_SYNAPS
00034 #endif // SYNAPS_UTIL_DEBUG_UTIL_H
00035