The DdtOStream Class is a subclass of OutputStream. DdtOStream objects provide a mechanism for sending one or more lines of output data to a log file used simultaneously by multiple threads. The output data sent to an OutputStream or DdtOStream is kept contiguous within the log file. Colliding requests wait for the current request to complete before their output is sent to the file.

Although it is unlikely a stub writer would create new DdtOStream objects, the following constructor method is available to create DdtOStream objects:

   DdtOStream(IString &filename);

The following method is available for DdtOStream objects:

   // Set or reset the automatic thread identifier prefix
   void settid(IString),

The following overloaded operator methods are available for Kwd_List objects:

   // Send the IString object to the DdtOStream
   void operator<<(IString& str);
   // Send the Buffer object to the DdtOStream
   void operator<<(Buffer& buf);

The bit-shift operator is overloaded to "look like" the redirection operator and is used to send IStrings to the output log:

   #include "threadio.h"
   .
   .
   param.files()->out1<<(IString)"Hello world!";

The only difference between a DdtOStream and an OutputStream is that each output to a DdtOStream is precluded with the current Thread Identification. The current threadID is set for DdtOStream when DDTT executes an @THREAD command. The current ThreadID can be changed through the settid method: out1.settid("New thread name");.


[Back: Kwd_List Class]
[Next: Buffer Class]