StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGridCollector.cxx
1 // //
3 // StGridCollector //
4 // //
5 // Loads the appropriate shared libraries //
6 // for the StGridCollector interface to the Grid Collector services //
7 // //
8 // John Wu <John.Wu@nersc.gov> //
9 // Based on StChallenger by //
10 // Alexandre V. Vaniachine <AVVaniachine@lbl.gov> //
12 #include "Riostream.h"
13 #include "TROOT.h"
14 #include "TClass.h"
15 #include "StGridCollector.h"
16 
17 ClassImp(StGridCollector)
18 //___________________________________________________________________________
19  StGridCollector* StGridCollector::Create(const char* sel) {
20  StGridCollector *serv = 0;
21 
22  //if (gROOT->LoadClass("libpthread","libpthread")) return 0;
23  //if (gROOT->LoadClass("libJTC","libJTC")) return 0;
24  //if (gROOT->LoadClass("libOB","libOB")) return 0;
25  //if (gROOT->LoadClass("libCosNaming","libCosNaming")) return 0;
26  if (gROOT->LoadClass("libGridCollector","libGridCollector")) return 0;
27 
28  TClass *c = gROOT->GetClass("Collector");
29  if (!c) {
30  std::cerr << "ERROR <StGridCollector::Create> failed to GetClass"
31  << std::endl;
32  return 0;
33  }
34 
35  serv = (StGridCollector *) c->New();
36  if(!serv)
37  std::cerr << "ERROR <StGridCollector::Create> failed to make a new "
38  << "GridCollector" << std::endl;
39  if (sel) {
40  if (*sel) {
41  int ierr = serv->Init(sel);
42  if (ierr) {
43  std::cerr << "ERROR <StGridCollector::Create(" << sel
44  << ")> failed to with error code " << ierr << std::endl;
45  delete serv;
46  serv = 0;
47  }
48  }
49  }
50 
51  return serv;
52 }
53 //___________________________________________________________________________