ROOT
master
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
//////////////////////////////////////////////////////////////////////////
13
// //
14
// TGrid //
15
// //
16
// Abstract base class defining interface to common GRID services. //
17
// //
18
// To open a connection to a GRID use the static method Connect(). //
19
// The argument of Connect() is of the form: //
20
// <grid>[://<host>][:<port>], e.g. alien://alice.cern.ch //
21
// Depending on the <grid> specified an appropriate plugin library //
22
// will be loaded which will provide the real interface. //
23
// //
24
// Related classes are TGridResult. //
25
// //
26
//////////////////////////////////////////////////////////////////////////
27
28
#include "
TGrid.h
"
29
#include "
TROOT.h
"
30
#include "
TPluginManager.h
"
31
#include "
TError.h
"
32
33
TGrid
*
gGrid
= 0;
34
35
36
ClassImp
(
TGrid
);
37
38
////////////////////////////////////////////////////////////////////////////////
39
/// The grid should be of the form: `<grid>://<host>[:<port>]`,
40
/// e.g.: alien://alice.cern.ch
41
/// The uid is the username and pw the password that should be used for
42
/// the connection. Depending on the `<grid>` the shared library (plugin)
43
/// for the selected system will be loaded. When the connection could not
44
/// be opened 0 is returned. For AliEn the supported options are:
45
/// -domain=`<domain name>`
46
/// -debug=`<debug level from 1 to 10>`
47
/// Example: "-domain=cern.ch -debug=5"
48
49
TGrid
*
TGrid::Connect
(
const
char
*
grid
,
const
char
*uid,
const
char
*
pw
,
50
const
char
*options)
51
{
52
TPluginHandler
*
h
;
53
TGrid
*
g
= 0;
54
55
if
(!
grid
) {
56
::Error
(
"TGrid::Connect"
,
"no grid specified"
);
57
return
0;
58
}
59
if
(!uid)
60
uid =
""
;
61
if
(!
pw
)
62
pw
=
""
;
63
if
(!options)
64
options =
""
;
65
66
if
((
h
=
gROOT
->GetPluginManager()->FindHandler(
"TGrid"
,
grid
))) {
67
if
(
h
->LoadPlugin() == -1) {
68
::Error
(
"TGrid::Connect"
,
"Loading Plugin failed"
);
69
return
0;
70
}
71
g
= (
TGrid
*)
h
->ExecPlugin(4,
grid
, uid,
pw
, options);
72
}
else
{
73
::Error
(
"TGrid::Connect"
,
"Could not find plugin to handle TGrid"
);
74
}
75
76
return
g
;
77
}
g
#define g(i)
Definition
RSha256.hxx:105
h
#define h(i)
Definition
RSha256.hxx:106
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:374
TError.h
gGrid
TGrid * gGrid
Definition
TGrid.cxx:33
TGrid.h
TPluginManager.h
TROOT.h
gROOT
#define gROOT
Definition
TROOT.h:406
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TGrid
Definition
TGrid.h:44
TGrid::Connect
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:49
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition
TObject.cxx:1020
TPluginHandler
Definition
TPluginManager.h:103
net
net
src
TGrid.cxx
ROOT master - Reference Guide Generated on Sun Mar 2 2025 15:20:26 (GVA Time) using Doxygen 1.10.0