#ifndef DEBUGSTRING_H #define DEBUGSTRING_H // DebugString.h #include #include "..\Threads\locks.h" template class DbgStr { public: static void add(const std::string& str) { dbgLock.lock(); dbgStr_.append(str); dbgLock.unlock(); } static std::string value() { dbgLock.lock(); std::string temp = dbgStr_; dbgLock.unlock(); return temp; } private: static std::string dbgStr_; static LLock dbgLock; }; template std::string DbgStr::dbgStr_ = ""; template LLock DbgStr::dbgLock; #endif