Ignore:
Timestamp:
01/14/04 10:13:02 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mreport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mreport/MReportFileRead.cc

    r2711 r2800  
    4242#include <fstream>
    4343
    44 #include <TClass.h>
    4544#include <TRegexp.h>
    4645#include <THashTable.h>
     
    4948#include "MLogManip.h"
    5049
    51 #include "MReport.h"
    5250#include "MParList.h"
     51#include "MReportHelp.h"
    5352
    5453ClassImp(MReportFileRead);
     
    5857const TString MReportFileRead::gsReportHeader ="[CC Report File]";
    5958const TString MReportFileRead::gsVersionPrefix="Arehucas Version Number";
    60 
    61 class MReportHelp : public TObject
    62 {
    63 private:
    64     MReport *fReport;
    65     ULong_t  fNumReports;
    66 
    67 public:
    68     MReportHelp(const char *name, MLog *fLog) : fReport(NULL), fNumReports(0)
    69     {
    70         TClass *cls = gROOT->GetClass(name);
    71         Int_t rc = 0;
    72         if (!cls)
    73             rc =1;
    74         else
    75         {
    76             if (!cls->Property())
    77                 rc = 5;
    78             if (!cls->Size())
    79                 rc = 4;
    80             if (!cls->IsLoaded())
    81                 rc = 3;
    82             if (!cls->HasDefaultConstructor())
    83                 rc = 2;
    84         }
    85 
    86         if (rc)
    87         {
    88             *fLog << err << dbginf << "Cannot create new instance of class '" << name << "': ";
    89             switch (rc)
    90             {
    91             case 1:
    92                 *fLog << "gROOT->GetClass() returned NULL." << endl;
    93                 return;
    94             case 2:
    95                 *fLog << "no default constructor." << endl;
    96                 return;
    97             case 3:
    98                 *fLog << "not loaded." << endl;
    99                 return;
    100             case 4:
    101                 *fLog << "zero size." << endl;
    102                 return;
    103             case 5:
    104                 *fLog << "no property." << endl;
    105                 return;
    106             }
    107         }
    108 
    109         //
    110         // create the parameter container of the the given class type
    111         //
    112         fReport = (MReport*)cls->New();
    113     }
    114     ~MReportHelp() { if (fReport) delete fReport; }
    115 
    116     const char *GetName() const { return fReport->GetIdentifier(); }
    117     ULong_t GetNumReports() const { return fNumReports; }
    118     ULong_t Hash() const { return fReport->GetIdentifier().Hash(); }
    119     MReport *GetReport() { return fReport; }
    120     //void SetTime(MTime *t) { fReport->SetTime(t); }
    121     Int_t Interprete(TString &str, const MTime &start, const MTime &stop)
    122     {
    123         const Int_t rc = fReport->Interprete(str, start, stop);
    124 
    125         if (rc==kFALSE)
    126             return kFALSE;
    127 
    128         fNumReports++;
    129         return rc;
    130     }
    131     Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); }
    132     void AddToList(MParList &plist) { plist.AddToList(fReport); }
    133 };
    13459
    13560// --------------------------------------------------------------------------
     
    183108    MReportHelp *help = new MReportHelp(name, fLog);
    184109
    185     MReport *rep = NULL;
    186     if (!(rep=help->GetReport()))
    187         return kFALSE;
    188 
    189     if (GetReport(rep->GetIdentifier()))
     110    if (!help->GetReport())
     111        return kFALSE;
     112
     113    if (GetReport(help->GetName()))
    190114    {
    191115        *fLog << warn << "WARNING - Report with Identifier '";
    192         *fLog << rep->GetIdentifier() << "' already added to the list... ";
     116        *fLog << help->GetName() << "' already added to the list... ";
    193117        *fLog << "ignored." << endl;
    194118        delete help;
  • trunk/MagicSoft/Mars/mreport/Makefile

    r2707 r2800  
    3333           MReportRun.cc \
    3434           MReportDAQ.cc \
     35           MReportHelp.cc \
    3536           MReportDrive.cc \
    3637           MReportCamera.cc \
     
    4950include ../Makefile.rules
    5051
    51 clean:  rmcint rmobjs rmcore rmlib
     52#clean: rmcint rmobjs rmcore rmlib
    5253
    5354mrproper:       clean rmbak
  • trunk/MagicSoft/Mars/mreport/ReportLinkDef.h

    r2707 r2800  
    1515#pragma link C++ class MReportCurrents+;
    1616
     17#pragma link C++ class MReportHelp+;
    1718#pragma link C++ class MReportFileRead+;
    1819
Note: See TracChangeset for help on using the changeset viewer.