63 #include "dcmtk/config/osconfig.h" 64 #include "dcmtk/ofstd/ofstream.h" 65 #include "dcmtk/ofstd/ofthread.h" 67 #define INCLUDE_CSTDLIB 68 #include "dcmtk/ofstd/ofstdinc.h" 129 STD_NAMESPACE ostream *
setCout(STD_NAMESPACE ostream *newCout=NULL);
166 if (
joined) coutMutex.unlock();
182 STD_NAMESPACE ostream *
setCerr(STD_NAMESPACE ostream *newCerr=NULL);
245 friend class OFConsoleDummyFriend;
252 #define ofConsole (OFConsole::instance()) 262 extern OFOStringStream COUT;
263 extern OFOStringStream CERR;
267 #define COUT (ofConsole.getCout()) 268 #define CERR (ofConsole.getCerr()) STD_NAMESPACE ostream * setCout(STD_NAMESPACE ostream *newCout=NULL)
exchanges the cout stream object.
STD_NAMESPACE ostream * currentCout
pointer to current cout stream, never NULL
STD_NAMESPACE ostream & lockCerr()
acquires a lock on the cerr stream and returns a reference to the stream.
STD_NAMESPACE ostream & lockCout()
acquires a lock on the cout stream and returns a reference to the stream.
STD_NAMESPACE ostream * setCerr(STD_NAMESPACE ostream *newCerr=NULL)
exchanges the cerr stream object.
OFConsole()
default constructor.
OFBool isJoined()
Checks whether cout and cerr are currently combined.
provides an operating system independent abstraction for mutexes (mutual exclusion locks)...
STD_NAMESPACE ostream & getCout()
returns a reference to the current cout stream.
STD_NAMESPACE ostream & getCerr()
returns a reference to the current cerr stream.
void join()
combines the cerr and cout streams.
void unlockCout()
releases the lock on the cout stream.
virtual ~OFConsole()
destructor.
OFConsole & operator=(const OFConsole &arg)
private undefined assignment operator
void unlockCerr()
releases the lock on the cerr stream.
Singleton class which provides thread-safe access to the standard console output and error streams...
STD_NAMESPACE ostream * currentCerr
pointer to current cerr stream, never NULL
int joined
true if streams are combined, false otherwise
void split()
splits combined cerr and cout streams.
static OFConsole & instance()
returns the singleton instance of this class.