DGD Library
Version: 0.1.0.14 | Updated: Thu Aug 10 16:58:53 2006
Home
DGD News
FAQ
Code Documentation
DGD Installation Guide
Bugs-n-Features
DGD at Sourceforge.net
Download DGD
Subversion
Code Documentation
Documentation
Namespaces
Class Hierarchy
Class List
File List
Namespace Members
Functions
Globals
Tutorial
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

dgFunnel.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // $Id$
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 // This file is part of Depression Glass library.
00020 //
00021 // Copyright (c) 2002. Dimitry Kloper <kloper@users.sf.net> . 
00022 //
00023 // dgFunnel.h -- channel funnel into physical stream
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 }; // end of namespace DGD
00134 
00135 #endif /* _dgFunnel_h_ */
00136 
00137 /* 
00138  * Local Variables:
00139  * compile-command: "make dgFunnel.obj"
00140  * End:
00141  */
00142 
00143 

Generated on Thu Aug 10 16:48:28 2006 for DGD Library by doxygen1.3

SourceForge.net Logo Powered by Mason Powered by Perl
Web design derived from Pasilda design found on www.oswd.org.
Copyright (c) 2002, 2003. Dimitry Kloper <kloper@users.sourceforge.net>