Changeset 2800 for trunk/MagicSoft/Mars/mreport
- Timestamp:
- 01/14/04 10:13:02 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mreport
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
r2711 r2800 42 42 #include <fstream> 43 43 44 #include <TClass.h>45 44 #include <TRegexp.h> 46 45 #include <THashTable.h> … … 49 48 #include "MLogManip.h" 50 49 51 #include "MReport.h"52 50 #include "MParList.h" 51 #include "MReportHelp.h" 53 52 54 53 ClassImp(MReportFileRead); … … 58 57 const TString MReportFileRead::gsReportHeader ="[CC Report File]"; 59 58 const TString MReportFileRead::gsVersionPrefix="Arehucas Version Number"; 60 61 class MReportHelp : public TObject62 {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 else75 {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 type111 //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 };134 59 135 60 // -------------------------------------------------------------------------- … … 183 108 MReportHelp *help = new MReportHelp(name, fLog); 184 109 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())) 190 114 { 191 115 *fLog << warn << "WARNING - Report with Identifier '"; 192 *fLog << rep->GetIdentifier() << "' already added to the list... ";116 *fLog << help->GetName() << "' already added to the list... "; 193 117 *fLog << "ignored." << endl; 194 118 delete help; -
trunk/MagicSoft/Mars/mreport/Makefile
r2707 r2800 33 33 MReportRun.cc \ 34 34 MReportDAQ.cc \ 35 MReportHelp.cc \ 35 36 MReportDrive.cc \ 36 37 MReportCamera.cc \ … … 49 50 include ../Makefile.rules 50 51 51 clean: rmcint rmobjs rmcore rmlib52 #clean: rmcint rmobjs rmcore rmlib 52 53 53 54 mrproper: clean rmbak -
trunk/MagicSoft/Mars/mreport/ReportLinkDef.h
r2707 r2800 15 15 #pragma link C++ class MReportCurrents+; 16 16 17 #pragma link C++ class MReportHelp+; 17 18 #pragma link C++ class MReportFileRead+; 18 19
Note:
See TracChangeset
for help on using the changeset viewer.