Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SYNCHCOUT_H_
00009 #define SYNCHCOUT_H_
00010
00011 #ifndef DISABLE_DECISION_MAKING_LOG
00012
00013 #include <boost/thread.hpp>
00014 #include <deque>
00015 #include <boost/thread/mutex.hpp>
00016 #include <boost/thread/condition.hpp>
00017 #include <boost/foreach.hpp>
00018
00019 using namespace std;
00020
00021
00022 struct Log{
00023 static boost::mutex& mutex(){ static boost::mutex LogMtx; return LogMtx; }
00024 boost::mutex::scoped_lock locker;
00025 Log():locker(mutex()){}
00026 template<class A>
00027 Log& operator<<(const A& a){ std::cout<<a; std::cout.flush(); return *this; }
00028 typedef void(*endl_t)();
00029 Log& operator<<(endl_t a){ std::cout<<std::endl; std::cout.flush(); return *this; }
00030 };
00031 inline void endl(){}
00032
00033 #define cout Log()
00034
00035 #define DMDEBUG(...) //__VA_ARGS__
00036
00037
00038 #endif
00039
00040
00041 #endif