Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBprintfBase.hxx

Go to the documentation of this file.
00001 #ifndef _CTBprintfBase_HXX
00002 #define _CTBprintfBase_HXX 1
00003 
00008 /*----------------------------------------------------------------------------*/
00009 /* C Tool Box: Designed and implemented by:                                   */
00010 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00011 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00012 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00013 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00014 /*------------------------------------------+---------------------------------*/
00015 
00016 class CTBprintfBase {
00017   public:
00018                     CTBprintfBase(const char* c_format, int i_width,
00019                                   int i_precision);
00020 
00021     virtual void    ToStream(ostream& os) const = 0;
00022 
00023   protected:
00024     const char*     mc_format;              
00025     int             mi_width;               
00026     int             mi_precision;           
00027 };
00028 
00029 ostream& operator<<(ostream& os, const CTBprintfBase& obj);
00030 
00031 //##############################################################################
00032 
00033 class CTBprintfBaseNd : public CTBprintfBase {
00034   public:
00035                     CTBprintfBaseNd(const char* c_format, int i_width,
00036                                     int i_precision, CTBint i_pcol, 
00037                                     CTBint i_wind);
00038 
00039   protected:
00040     CTBint          mi_pcol;                
00041     CTBint          mi_wind;                
00042 };
00043 
00044 //##############################################################################
00045 
00046 class CTBprintfBase1d : public CTBprintfBaseNd {
00047   public:
00048                     CTBprintfBase1d(const char* c_format, int i_width,
00049                                     int i_precision, CTBint i_pcol,
00050                                     CTBint i_wind);
00051 
00052     virtual void    ToStream(ostream& os) const;
00053     virtual void    ToStreamElement(ostream& os, CTBint i) const = 0;
00054 
00055     virtual CTBint  Dimension1() const = 0;
00056 };
00057 
00058 //##############################################################################
00059 
00060 class CTBprintfBase2d : public CTBprintfBaseNd {
00061   public:
00062                     CTBprintfBase2d(const char* c_format, int i_width,
00063                                     int i_precision, CTBint i_pcol, 
00064                                     CTBint i_wind, bool b_sep12 = false);
00065 
00066     virtual void    ToStream(ostream& os) const;
00067     virtual void    ToStreamElement(ostream& os, 
00068                                     CTBint i1, CTBint i2) const = 0;
00069 
00070     virtual CTBint  Dimension1() const = 0;
00071     virtual CTBint  Dimension2(CTBint i1) const = 0;
00072 
00073   protected:
00074     bool            mb_sep12;               
00075 };
00076 
00077 //##############################################################################
00078 
00079 class CTBprintfBase3d : public CTBprintfBaseNd {
00080   public:
00081                     CTBprintfBase3d(const char* c_format, int i_width,
00082                                     int i_precision, CTBint i_pcol, 
00083                                     CTBint i_wind, bool b_sep12 = false,
00084                                     bool b_sep23 = false);
00085 
00086     virtual void    ToStream(ostream& os) const;
00087     virtual void    ToStreamElement(ostream& os, 
00088                                     CTBint i1, CTBint i2, CTBint i3) const = 0;
00089 
00090     virtual CTBint  Dimension1() const = 0;
00091     virtual CTBint  Dimension2(CTBint i1) const = 0;
00092     virtual CTBint  Dimension3(CTBint i1, CTBint i2) const = 0;
00093 
00094   protected:
00095     bool            mb_sep12;               
00096     bool            mb_sep23;               
00097 };
00098 
00099 #include "CTBprintfBase.icc"
00100 
00101 #endif

Generated at Fri Oct 24 18:11:29 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001