Ignore:
Timestamp:
06/13/03 16:42:37 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r2156 r2173  
    1010#pragma link C++ global kRad2Deg;
    1111//#pragma link C++ global kPI;
    12 
    13 #pragma link C++ function __omanip_debug;
    1412
    1513#pragma link C++ global gLog;
  • trunk/MagicSoft/Mars/mbase/MClone.cc

    r1080 r2173  
    5858
    5959ClassImp(MClone);
     60
     61using namespace std;
    6062
    6163// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MContinue.cc

    r2117 r2173  
    5050
    5151ClassImp(MContinue);
     52
     53using namespace std;
    5254
    5355// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2161 r2173  
    7070
    7171#include <time.h>           // time_t
    72 #include <fstream.h>        // ofstream, SavePrimitive
    73 #include <iostream.h>
     72#include <fstream>          // ofstream, SavePrimitive
    7473
    7574#include <TTime.h>          // TTime
     
    9190
    9291ClassImp(MEvtLoop);
     92
     93using namespace std;
    9394
    9495
  • trunk/MagicSoft/Mars/mbase/MGList.cc

    r1353 r2173  
    3535#include "MGList.h"
    3636
    37 #include <iostream.h>
     37#include <iostream>
    3838
    3939#include <TClass.h>
     
    4242#include <TGPicture.h>
    4343
    44 
    4544ClassImp(MGList);
     45
     46using namespace std;
    4647
    4748// --------------------------------------------------------------------------
     
    149150    if (IsExisting(obj))
    150151    {
     152        // FIXME: Replace by gLog
    151153        const Int_t id = GetWidget(obj)->WidgetId();
    152154        cout << "Widget with id #" << id << " (";
  • trunk/MagicSoft/Mars/mbase/MGTask.cc

    r1080 r2173  
    4141
    4242ClassImp(MGTask);
     43
     44using namespace std;
    4345
    4446// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r2120 r2173  
    9797
    9898#include <stdlib.h>     // mkstempe
    99 #include <fstream.h>
     99#include <fstream>
    100100#ifdef _REENTRANT
    101101#include <pthread.h>
     
    106106
    107107ClassImp(MLog);
     108
     109using namespace std;
    108110
    109111// root 3.02:
     
    210212// copyt constructor
    211213//
    212 MLog::MLog(MLog &log)
    213 {
    214     fOutputLevel = log.fOutputLevel;
    215     fDebugLevel  = log.fDebugLevel;
    216     fDevice      = log.fDevice;
    217 }
     214/*
     215MLog::MLog(MLog const& log)
     216{
     217//    fOutputLevel = log.fOutputLevel;
     218//    fDebugLevel  = log.fDebugLevel;
     219//    fDevice      = log.fDevice;
     220}
     221*/
    218222
    219223void MLog::Underline()
     
    447451void MLog::AllocateFile(const char *fname)
    448452{
     453    // gcc 3.2:
    449454    char *txt = (char*)"logXXXXXX";
    450     fout = fname ? new ofstream(fname) : new ofstream(mkstemp(txt));
     455    fout = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/);
    451456    fOutAllocated = kTRUE;
    452457}
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r2123 r2173  
    99#endif
    1010
    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
    1712
    1813#define bsz    160 // two standard lines
     
    2015class TGTextView;
    2116
    22 class MLog : public streambuf, public ostream, public TObject
     17class MLog : public std::streambuf, public std::ostream, public TObject
    2318{
    2419public:
     
    9489    MLog(const char *fname, int flag=-1);
    9590
    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    }
    9797    ~MLog();
    9898
     
    186186        const int save = fOutputLevel;
    187187        SetOutputLevel(outlvl);
    188         (*this) << str << endl;
     188        (*this) << str << std::endl;
    189189        fOutputLevel = save;
    190190    }
  • trunk/MagicSoft/Mars/mbase/MLogManip.cc

    r2120 r2173  
    2525#include "MLog.h"
    2626#include "MLogManip.h"
    27 
     27/*
    2828// ----------------------------------------------------------------
    2929//            Definitions of the manipulator functions
     
    124124    return lout;
    125125}
    126 
     126*/
  • trunk/MagicSoft/Mars/mbase/MLogManip.h

    r2142 r2173  
    22#define MARS_MLogManip
    33
    4 #include <iomanip.h>
     4#include <iomanip>
    55
    6 // ----------------------------------------------------------------
    7 //                 Definitions of the manipulators
    8 // ----------------------------------------------------------------
     6#include "MLog.h"
    97
    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 -----------------------
    159
    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       }
     10enum MLogManip {
     11    underline
     12};
    2313
    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        }
     14inline 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}
    3121
    32 #endif
    3322
    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 -----------------------------
    4824
    49 // ----------------------------------------------------------------
    50 //                         Debug helper macros
    51 // ----------------------------------------------------------------
     25struct _Debug { int level; };
    5226
    53 //
    54 // Output debug information into the stream
    55 //  - this can only be done by a macro
    56 //
     27inline _Debug debug(int level)
     28{
     29    _Debug d;
     30    d.level = level;
     31    return d;
     32}
     33
     34inline 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
     44struct _EnableDev { MLog::_flags dev; };
     45
     46inline _EnableDev edev(MLog::_flags i)
     47{
     48    _EnableDev e;
     49    e.dev = i;
     50    return e;
     51}
     52
     53inline 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
     63struct _DisableDev { MLog::_flags dev; };
     64
     65inline _DisableDev ddev(MLog::_flags i)
     66{
     67    _DisableDev d;
     68    d.dev = i;
     69    return d;
     70}
     71
     72inline 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
    5782#ifndef __CINT__
    58 //#define dbginf dbg << __FILE__ << " l." << dec << __LINE__ << ": "
    5983#define dbginf __FILE__ << " l." << dec << __LINE__ << ": "
    6084#define all    debug(0) // use this for output in any case
     
    6488#define dbg    debug(4) // use this for debug messages (blue)
    6589#endif
    66 //
    67 // flush the old buffer, set a new debug level
    68 // and output the debug information code
    69 //
    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) << dbginf
    76 #endif
    77 */
    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 */
    9790
    9891#endif
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r2109 r2173  
    3838
    3939#include <ctype.h>        // isdigit
    40 #include <fstream.h>      // ofstream, AsciiWrite
     40#include <fstream      // ofstream, AsciiWrite
    4141
    4242#include <TEnv.h>         // Env::Lookup
     
    5858
    5959ClassImp(MParContainer);
     60
     61using namespace std;
    6062
    6163// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r2120 r2173  
    2020#endif
    2121
    22 class ofstream;
    23 class ifstream;
     22// gcc 3.2
     23#include <iosfwd>
     24//class ofstream;
     25//class ifstream;
    2426
    2527class TEnv;
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r2120 r2173  
    4141#include "MParList.h"
    4242
    43 #include <fstream.h>     // ofstream, SavePrimitive
     43#include <fstream>     // ofstream, SavePrimitive
    4444
    4545#include <TNamed.h>
     
    5353
    5454ClassImp(MParList);
     55
     56using namespace std;
    5557
    5658static const TString gsDefName  = "MParList";
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r1542 r2173  
    4646
    4747ClassImp(MPrint);
     48
     49using namespace std;
    4850
    4951// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r2117 r2173  
    6868#include "MTask.h"
    6969
    70 #include <fstream.h>
     70#include <fstream>
    7171#include <TBaseClass.h>
    7272
     
    7979
    8080ClassImp(MTask);
     81
     82using namespace std;
    8183
    8284MTask::MTask(const char *name, const char *title)
  • trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc

    r2156 r2173  
    3636#include "MTaskInteractive.h"
    3737
    38 #include <iostream.h>
    39 
    4038#include <Api.h>
    4139#include <TMethodCall.h>
     
    4543
    4644ClassImp(MTaskInteractive);
     45
     46using namespace std;
    4747
    4848// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r2120 r2173  
    5757#include "MTaskList.h"
    5858
    59 #include <fstream.h>        // ofstream, SavePrimitive
     59#include <fstream>        // ofstream, SavePrimitive
    6060
    6161#include <TClass.h>
     
    7373
    7474ClassImp(MTaskList);
     75
     76using namespace std;
    7577
    7678const TString MTaskList::gsDefName  = "MTaskList";
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r1080 r2173  
    3333#include "MTime.h"
    3434
    35 #include <iomanip.h>
     35#include <iomanip>
    3636
    3737#include "MLog.h"
    3838
    3939ClassImp(MTime);
     40
     41using namespace std;
    4042
    4143void MTime::Print(Option_t *) const
Note: See TracChangeset for help on using the changeset viewer.