Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGrid.cxx
Go to the documentation of this file.
1// @(#)root/net:$Id$
2// Author: Fons Rademakers 3/1/2002
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TGrid.h"
13#include "TROOT.h"
14#include "TPluginManager.h"
15#include "TError.h"
16
18
19
20
21////////////////////////////////////////////////////////////////////////////////
22/// The grid should be of the form: `<grid>://<host>[:<port>]`,
23/// e.g.: alien://alice.cern.ch
24/// The uid is the username and pw the password that should be used for
25/// the connection. Depending on the `<grid>` the shared library (plugin)
26/// for the selected system will be loaded. When the connection could not
27/// be opened 0 is returned. For AliEn the supported options are:
28/// -domain=`<domain name>`
29/// -debug=`<debug level from 1 to 10>`
30/// Example: "-domain=cern.ch -debug=5"
31
32TGrid *TGrid::Connect(const char *grid, const char *uid, const char *pw,
33 const char *options)
34{
36 TGrid *g = 0;
37
38 if (!grid) {
39 ::Error("TGrid::Connect", "no grid specified");
40 return 0;
41 }
42 if (!uid)
43 uid = "";
44 if (!pw)
45 pw = "";
46 if (!options)
47 options = "";
48
49 if ((h = gROOT->GetPluginManager()->FindHandler("TGrid", grid))) {
50 if (h->LoadPlugin() == -1) {
51 ::Error("TGrid::Connect", "Loading Plugin failed");
52 return 0;
53 }
54 g = (TGrid *) h->ExecPlugin(4, grid, uid, pw, options);
55 } else {
56 ::Error("TGrid::Connect", "Could not find plugin to handle TGrid");
57 }
58
59 return g;
60}
#define g(i)
Definition RSha256.hxx:105
#define h(i)
Definition RSha256.hxx:106
TGrid * gGrid
Definition TGrid.cxx:17
#define gROOT
Definition TROOT.h:417
Abstract base class defining interface to common GRID services.
Definition TGrid.h:46
static TGrid * Connect(const char *grid, const char *uid=nullptr, const char *pw=nullptr, const char *options=nullptr)
The grid should be of the form: <grid>://<host>[:<port>], e.g.: alien://alice.cern....
Definition TGrid.cxx:32
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098