Changeset 2173 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 06/13/03 16:42:37 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r2156 r2173 10 10 #pragma link C++ global kRad2Deg; 11 11 //#pragma link C++ global kPI; 12 13 #pragma link C++ function __omanip_debug;14 12 15 13 #pragma link C++ global gLog; -
trunk/MagicSoft/Mars/mbase/MClone.cc
r1080 r2173 58 58 59 59 ClassImp(MClone); 60 61 using namespace std; 60 62 61 63 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r2117 r2173 50 50 51 51 ClassImp(MContinue); 52 53 using namespace std; 52 54 53 55 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2161 r2173 70 70 71 71 #include <time.h> // time_t 72 #include <fstream.h> // ofstream, SavePrimitive 73 #include <iostream.h> 72 #include <fstream> // ofstream, SavePrimitive 74 73 75 74 #include <TTime.h> // TTime … … 91 90 92 91 ClassImp(MEvtLoop); 92 93 using namespace std; 93 94 94 95 -
trunk/MagicSoft/Mars/mbase/MGList.cc
r1353 r2173 35 35 #include "MGList.h" 36 36 37 #include <iostream .h>37 #include <iostream> 38 38 39 39 #include <TClass.h> … … 42 42 #include <TGPicture.h> 43 43 44 45 44 ClassImp(MGList); 45 46 using namespace std; 46 47 47 48 // -------------------------------------------------------------------------- … … 149 150 if (IsExisting(obj)) 150 151 { 152 // FIXME: Replace by gLog 151 153 const Int_t id = GetWidget(obj)->WidgetId(); 152 154 cout << "Widget with id #" << id << " ("; -
trunk/MagicSoft/Mars/mbase/MGTask.cc
r1080 r2173 41 41 42 42 ClassImp(MGTask); 43 44 using namespace std; 43 45 44 46 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MLog.cc
r2120 r2173 97 97 98 98 #include <stdlib.h> // mkstempe 99 #include <fstream .h>99 #include <fstream> 100 100 #ifdef _REENTRANT 101 101 #include <pthread.h> … … 106 106 107 107 ClassImp(MLog); 108 109 using namespace std; 108 110 109 111 // root 3.02: … … 210 212 // copyt constructor 211 213 // 212 MLog::MLog(MLog &log) 213 { 214 fOutputLevel = log.fOutputLevel; 215 fDebugLevel = log.fDebugLevel; 216 fDevice = log.fDevice; 217 } 214 /* 215 MLog::MLog(MLog const& log) 216 { 217 // fOutputLevel = log.fOutputLevel; 218 // fDebugLevel = log.fDebugLevel; 219 // fDevice = log.fDevice; 220 } 221 */ 218 222 219 223 void MLog::Underline() … … 447 451 void MLog::AllocateFile(const char *fname) 448 452 { 453 // gcc 3.2: 449 454 char *txt = (char*)"logXXXXXX"; 450 fout = fname ? new ofstream(fname) : new ofstream( mkstemp(txt));455 fout = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/); 451 456 fOutAllocated = kTRUE; 452 457 } -
trunk/MagicSoft/Mars/mbase/MLog.h
r2123 r2173 9 9 #endif 10 10 11 #ifndef __CINT__ 12 #include <iostream.h> // base classes for MLog 13 #else 14 class streambuf; 15 class ostream; 16 #endif 11 #include <iostream> // base classes for MLog 17 12 18 13 #define bsz 160 // two standard lines … … 20 15 class TGTextView; 21 16 22 class MLog : public st reambuf, publicostream, public TObject17 class MLog : public std::streambuf, public std::ostream, public TObject 23 18 { 24 19 public: … … 94 89 MLog(const char *fname, int flag=-1); 95 90 96 MLog(MLog &log); 91 MLog(MLog const& log) : ostream((std::streambuf*)&log) 92 { 93 fOutputLevel = log.fOutputLevel; 94 fDebugLevel = log.fDebugLevel; 95 fDevice = log.fDevice; 96 } 97 97 ~MLog(); 98 98 … … 186 186 const int save = fOutputLevel; 187 187 SetOutputLevel(outlvl); 188 (*this) << str << endl;188 (*this) << str << std::endl; 189 189 fOutputLevel = save; 190 190 } -
trunk/MagicSoft/Mars/mbase/MLogManip.cc
r2120 r2173 25 25 #include "MLog.h" 26 26 #include "MLogManip.h" 27 27 /* 28 28 // ---------------------------------------------------------------- 29 29 // Definitions of the manipulator functions … … 124 124 return lout; 125 125 } 126 126 */ -
trunk/MagicSoft/Mars/mbase/MLogManip.h
r2142 r2173 2 2 #define MARS_MLogManip 3 3 4 #include <iomanip .h>4 #include <iomanip> 5 5 6 // ---------------------------------------------------------------- 7 // Definitions of the manipulators 8 // ---------------------------------------------------------------- 6 #include "MLog.h" 9 7 10 // 11 // define a general simple macro for manipulator definitions (int) 12 // 13 #define MANIPULATOR0(name) \ 14 extern ostream& ##name(ostream& lout); 8 // --------------------- simple manipulators ----------------------- 15 9 16 #ifndef OMANIP 17 #define MANIPULATOR1(name) \ 18 extern ostream& __omanip_##name(ostream& lout, int i); \ 19 inline omanip<int> ##name(int i) \ 20 { \ 21 return omanip<int>(__omanip_##name, i); \ 22 } 10 enum MLogManip { 11 underline 12 }; 23 13 24 #else 25 #define MANIPULATOR1(name) \ 26 extern ostream& __omanip_##name(ostream& lout, int i); \27 inline OMANIP(int) ##name(int i) \28 { \29 return OMANIP(int)(__omanip_##name, i); \30 14 inline std::ostream &operator<<(std::ostream &lout, MLogManip u) 15 { 16 MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf(); 17 if (log) 18 log->Underline(); 19 return lout; 20 } 31 21 32 #endif33 22 34 // 35 // definitions 36 // 37 MANIPULATOR0(underline); // underline output 38 MANIPULATOR1(debug); // set debug level 39 MANIPULATOR1(device); // set ouput devices 40 MANIPULATOR1(edev); // enable additional output devices 41 MANIPULATOR1(ddev); // disable given output 42 //#ifndef __CINT__ 43 //__DEFINE_IOMANIP_FN1(smanip, int, debug); // set debug level 44 //__DEFINE_IOMANIP_FN1(smanip, int, device); // set ouput devices 45 //__DEFINE_IOMANIP_FN1(smanip, int, edev); // enable additional output devices 46 //__DEFINE_IOMANIP_FN1(smanip, int, ddev); // disable given output 47 //#endif 23 // ----------------------------- debug ----------------------------- 48 24 49 // ---------------------------------------------------------------- 50 // Debug helper macros 51 // ---------------------------------------------------------------- 25 struct _Debug { int level; }; 52 26 53 // 54 // Output debug information into the stream 55 // - this can only be done by a macro 56 // 27 inline _Debug debug(int level) 28 { 29 _Debug d; 30 d.level = level; 31 return d; 32 } 33 34 inline std::ostream &operator<<(std::ostream &lout, _Debug d) 35 { 36 MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf(); 37 if (log) 38 log->SetOutputLevel(d.level); 39 return lout; 40 } 41 42 // ------------------------------- edev ---------------------------- 43 44 struct _EnableDev { MLog::_flags dev; }; 45 46 inline _EnableDev edev(MLog::_flags i) 47 { 48 _EnableDev e; 49 e.dev = i; 50 return e; 51 } 52 53 inline std::ostream &operator<<(std::ostream &lout, _EnableDev e) 54 { 55 MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf(); 56 if (log) 57 log->EnableOutputDevice(e.dev); 58 return lout; 59 } 60 61 // ------------------------------- sdev ---------------------------- 62 63 struct _DisableDev { MLog::_flags dev; }; 64 65 inline _DisableDev ddev(MLog::_flags i) 66 { 67 _DisableDev d; 68 d.dev = i; 69 return d; 70 } 71 72 inline std::ostream &operator<<(std::ostream &lout, _DisableDev d) 73 { 74 MLog *log=/*<dynamic_cast>*/(MLog*)lout.rdbuf(); 75 if (log) 76 log->EnableOutputDevice(d.dev); 77 return lout; 78 } 79 80 // ------------------------------ Macros --------------------------- 81 57 82 #ifndef __CINT__ 58 //#define dbginf dbg << __FILE__ << " l." << dec << __LINE__ << ": "59 83 #define dbginf __FILE__ << " l." << dec << __LINE__ << ": " 60 84 #define all debug(0) // use this for output in any case … … 64 88 #define dbg debug(4) // use this for debug messages (blue) 65 89 #endif 66 //67 // flush the old buffer, set a new debug level68 // and output the debug information code69 //70 // Be careful: Only use them with a MLogging stream facility.71 // Remark: All this is compiled into the code.72 //73 /*74 #ifndef __CINT__75 #define DEBUG(lvl) flush << debug(lvl) << dbginf76 #endif77 */78 /*79 class SMANIP(T) {80 ios& (*fct)(ios&,T) ;81 T arg ;82 public:83 SMANIP(T)(ios& (*f)(ios&, T), T a) :84 fct(f), arg(a) { }85 friend istream& operator>>(istream& i, const SMANIP(T)& m)86 {87 ios* s = &i ;88 (*m.fct)(*s,m.arg) ; return i ;89 }90 friend ostream& operator<<(ostream& o, const SMANIP(T)& m)91 {92 ios* s = &o ;93 (*m.fct)(*s,m.arg) ; return o ;94 }95 } ;96 */97 90 98 91 #endif -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r2109 r2173 38 38 39 39 #include <ctype.h> // isdigit 40 #include <fstream .h>// ofstream, AsciiWrite40 #include <fstream> // ofstream, AsciiWrite 41 41 42 42 #include <TEnv.h> // Env::Lookup … … 58 58 59 59 ClassImp(MParContainer); 60 61 using namespace std; 60 62 61 63 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r2120 r2173 20 20 #endif 21 21 22 class ofstream; 23 class ifstream; 22 // gcc 3.2 23 #include <iosfwd> 24 //class ofstream; 25 //class ifstream; 24 26 25 27 class TEnv; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r2120 r2173 41 41 #include "MParList.h" 42 42 43 #include <fstream .h> // ofstream, SavePrimitive43 #include <fstream> // ofstream, SavePrimitive 44 44 45 45 #include <TNamed.h> … … 53 53 54 54 ClassImp(MParList); 55 56 using namespace std; 55 57 56 58 static const TString gsDefName = "MParList"; -
trunk/MagicSoft/Mars/mbase/MPrint.cc
r1542 r2173 46 46 47 47 ClassImp(MPrint); 48 49 using namespace std; 48 50 49 51 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MTask.cc
r2117 r2173 68 68 #include "MTask.h" 69 69 70 #include <fstream .h>70 #include <fstream> 71 71 #include <TBaseClass.h> 72 72 … … 79 79 80 80 ClassImp(MTask); 81 82 using namespace std; 81 83 82 84 MTask::MTask(const char *name, const char *title) -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
r2156 r2173 36 36 #include "MTaskInteractive.h" 37 37 38 #include <iostream.h>39 40 38 #include <Api.h> 41 39 #include <TMethodCall.h> … … 45 43 46 44 ClassImp(MTaskInteractive); 45 46 using namespace std; 47 47 48 48 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r2120 r2173 57 57 #include "MTaskList.h" 58 58 59 #include <fstream .h> // ofstream, SavePrimitive59 #include <fstream> // ofstream, SavePrimitive 60 60 61 61 #include <TClass.h> … … 73 73 74 74 ClassImp(MTaskList); 75 76 using namespace std; 75 77 76 78 const TString MTaskList::gsDefName = "MTaskList"; -
trunk/MagicSoft/Mars/mbase/MTime.cc
r1080 r2173 33 33 #include "MTime.h" 34 34 35 #include <iomanip .h>35 #include <iomanip> 36 36 37 37 #include "MLog.h" 38 38 39 39 ClassImp(MTime); 40 41 using namespace std; 40 42 41 43 void MTime::Print(Option_t *) const
Note:
See TracChangeset
for help on using the changeset viewer.