00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _dgFunnel_h_
00027 #define _dgFunnel_h_
00028
00034 #include "dgChannelBuf.h"
00035
00036 namespace DGD {
00037
00038 class funnel;
00039
00057 class funnelbuf: public channelbuf {
00058 public:
00059 friend class funnel;
00060
00065 class Callback {
00066 public:
00067 virtual void operator () ( unsigned long line,
00068 unsigned long column,
00069 unsigned long bytes ) = 0;
00070 };
00071
00072 private:
00073 void post_process();
00074
00075 void assoc( std::ostream* );
00076
00077 void callback( Callback* cb );
00078 const Callback* callback() const;
00079
00080 public:
00081 funnelbuf();
00082 ~funnelbuf();
00083
00084 private:
00085 Callback* m_callback;
00086 };
00087
00110 class funnel: public std::ostream, public funnelbuf::Callback {
00111 public:
00112 typedef std::ostream Parent;
00113
00114 public:
00115 funnel( std::ostream& physical_stream );
00116 funnelbuf& rdbuf();
00117
00118 virtual void header();
00119
00120 protected:
00125 virtual void operator () ( unsigned long line,
00126 unsigned long column,
00127 unsigned long bytes ) {};
00128
00129 private:
00130 funnelbuf m_buffer;
00131 };
00132
00133 };
00134
00135 #endif
00136
00137
00138
00139
00140
00141
00142
00143