Go to the documentation of this file. 1 #ifndef GCP_UTIL_IOLOCK_H
2 #define GCP_UTIL_IOLOCK_H
11 #include "gcp/util/common/Mutex.h"
13 #define IOCOUT(statement) \
15 gcp::util::IoLock::lockCout(); \
16 std::cout << statement << std::endl; \
17 gcp::util::IoLock::unlockCout(); \
20 #define IOCTOUT(statement) \
22 gcp::util::TimeVal timeVal;\
23 timeVal.setToCurrentTime();\
24 gcp::util::IoLock::lockCout(); \
25 std::cout << timeVal << ": " << statement << std::endl; \
26 gcp::util::IoLock::unlockCout(); \
29 #define IOCERR(statement) \
31 gcp::util::IoLock::lockCerr(); \
32 std::cerr << statement << std::endl; \
33 gcp::util::IoLock::unlockCerr(); \
47 static void lockCout();
48 static void unlockCout();
49 static void lockCerr();
50 static void unlockCerr();
54 static Mutex coutMutex_;
55 static Mutex cerrMutex_;
70 #endif // End #ifndef GCP_UTIL_IOLOCK_H
virtual ~IoLock()
Definition: IoLock.cc:27