Classes | Defines

lib-during/utils/io-lock.h File Reference

Utility class to temporarily lock stdout or stderr. More...

#include <boost/thread.hpp>
#include <iostream>
Include dependency graph for io-lock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cout_lock< fd >

Defines

#define L_COUT
#define L_CERR
#define D_COUT   if (0) L_COUT

Detailed Description

Utility class to temporarily lock stdout or stderr.

Definition in file io-lock.h.


Define Documentation

#define D_COUT   if (0) L_COUT

Debug COUT. Define SC_DURING_DEBUG to activate.

Definition at line 62 of file io-lock.h.

#define L_CERR
Value:
for (cout_lock<2> cout_lock_instance;   \
             cout_lock_instance.stop(); \
             cout_lock_instance.incr()) std::cerr

Same as L_COUT, but for cerr

Definition at line 51 of file io-lock.h.

#define L_COUT
Value:
for (cout_lock<1> cout_lock_instance;   \
             cout_lock_instance.stop(); \
             cout_lock_instance.incr()) std::cout

Use for variable scope to hold the mutex for a single line.

Usage: L_COUT << "foo" << bar << endl;

Definition at line 43 of file io-lock.h.

 All Classes Files Functions Defines