Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more/cf/clip.h

Go to the documentation of this file.
00001 //  ---   T h r e a d s   w i t h   I O   ---
00002 
00003 
00004 class thread_with_io;
00005 
00006 struct ithreadstream : public std::istream
00007   { ithreadstream(thread_with_io&); };
00008 struct othreadstream : public std::ostream
00009   { othreadstream(thread_with_io&); };
00010 
00011 class thread_with_io : public thread {
00012     friend class ithreadstream;
00013     friend class othreadstream;
00014     bool input_in_use, output_in_use;
00015     pipe_streambuf input_pipestreambuf;  // very private!
00016     pipe_streambuf output_pipestreambuf;
00017 
00018 protected:
00019     std::istream tin;
00020     std::ostream tout;
00021 
00022 public:
00023     thread_with_io()
00024         : tin(&input_pipestreambuf),
00025           tout(&output_pipestreambuf) {}
00026 };
00027 
00028 
00029 inline ithreadstream::ithreadstream(thread_with_io& th)
00030     : std::istream(&th.output_pipestreambuf) {}
00031 inline othreadstream::othreadstream(thread_with_io& th)
00032     : std::ostream(&th.input_pipestreambuf) {}
00033 
00034 

Generated on Sat Sep 7 19:11:10 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.