Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/BdbUtil/BdbDebug.hh

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 // File:
00003 //      BdbDebug.hh
00004 //
00005 // Description:
00006 //      Defines class BdbDebug and streams for two-level debug information 
00007 //
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author List:
00012 //      Jacek Becla
00013 //
00014 // Copyright Information:
00015 //      Copyright (C) 1997      Stanford Linear Accelerator Center
00016 //
00017 //---------------------------------------------------------------------------
00018 
00019 #ifndef BDBDEBUG_HH
00020 #define BDBDEBUG_HH 
00021 
00022 //-------------
00023 // C Headers --
00024 //-------------
00025 #include <fstream.h>
00026 #include <iostream.h>
00027 #include "BdbUtil/BdbIOStreamManip.hh"
00028 
00029 
00030 class BdbDebug 
00031 {
00032 public:
00033    ~BdbDebug();
00034 
00035    static ofstream& one() { sharedInstance() ; return out1 ; }
00036    static ofstream& two() { sharedInstance() ; return out2 ; }
00037 
00038    // These are only "public" for compatablilty reasons. These
00039    //   shuld not be used directly, but the above accessors should
00040    //   be used.
00041    static ofstream out1, out2;
00042 private:
00043    enum StreamDef { First, Second, Both };
00044 
00045    static int _isFile1, _isFile2;
00046    static int _mode;
00047    static void streamInit(const char* name, StreamDef which);
00048 
00049 
00050    static BdbDebug* sharedInstance() ;
00051 
00052    void init(int mode=ios::out);
00053 } ;
00054 
00055 #define COUT1 BdbDebug::one() << BdbTimeStamp() 
00056 #define COUT2 BdbDebug::two() << BdbTimeStamp() 
00057 #define COUT1n BdbDebug::one()
00058 #define COUT2n BdbDebug::two()
00059 
00060 #endif /* BDBDEBUG_HH */

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002