00001 00002 // $Id: JobCROOT.h,v 1.15 2005/04/19 09:58:49 rhatcher Exp $ 00003 // 00004 // Interface for JobController for ROOT 00005 // 00006 // messier@huhepl.harvard.edu 00008 #ifndef JOBCROOT_H 00009 #define JOBCROOT_H 00010 #ifndef CSTDLIB 00011 #include <cstdlib> 00012 #define CSTDLIB 00013 #endif 00014 #ifndef ROOT_Rtypes 00015 #if !defined(__CINT__) || defined(__MAKECINT__) 00016 #include "Rtypes.h" // Needed for ClassDef and ClassImp macros 00017 #endif 00018 #endif 00019 00020 class JobController; 00021 class MomNavigator; 00022 00023 class JobCROOT 00024 { 00025 public: 00026 virtual ~JobCROOT(); 00027 00028 void operator()(const char *input); 00029 00030 static JobCROOT& Instance(); 00031 00032 // Special methods that might be needed in a root session 00033 MomNavigator* GetMom(); 00034 00035 private: 00036 JobCROOT(); 00037 JobCROOT(const JobCROOT& /* x */) { abort(); } 00038 JobCROOT& operator=(const JobCROOT& /* x */) { abort(); } 00039 struct Cleaner { 00040 void ClassIsUsed() { } // Keeps compiler's quiet if class is used 00041 ~Cleaner() { 00042 if(JobCROOT::fInstance!=0) { 00043 delete JobCROOT::fInstance; 00044 JobCROOT::fInstance=0; 00045 } 00046 } 00047 }; 00048 friend struct Cleaner; 00049 00050 static JobCROOT* fInstance; // The instance of the interface 00051 00052 public: 00053 ClassDef(JobCROOT,0) // ROOT def. for interface class 00054 }; 00055 #endif 00056 00057
1.3.9.1