Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:26:50

0001 // @(#)root/net:$Id$
0002 // Author: Fons Rademakers   3/1/2002
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGrid
0013 #define ROOT_TGrid
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TGrid                                                                //
0018 //                                                                      //
0019 // Abstract base class defining interface to common GRID services.      //
0020 //                                                                      //
0021 // To open a connection to a GRID use the static method Connect().      //
0022 // The argument of Connect() is of the form:                            //
0023 //    <grid>://<host>[:<port>], e.g. alien://alice.cern.ch              //
0024 // Depending on the <grid> specified an appropriate plugin library      //
0025 // will be loaded which will provide the real interface.                //
0026 //                                                                      //
0027 // Related classes are TGridResult.                                     //
0028 //                                                                      //
0029 //////////////////////////////////////////////////////////////////////////
0030 
0031 #include "TObject.h"
0032 
0033 #include "TString.h"
0034 
0035 #include "TGridJob.h"
0036 
0037 namespace ROOT::Deprecated {
0038 
0039 class TGridCollection;
0040 class TGridJDL;
0041 class TGridJob;
0042 class TGridJobStatusList;
0043 class TGridResult;
0044 
0045 class TGrid : public TObject {
0046 
0047 protected:
0048    TString        fGridUrl; // the GRID url used to create the grid connection
0049    TString        fGrid;    // type of GRID (AliEn, ...)
0050    TString        fHost;    // GRID portal to which we are connected
0051    TString        fUser;    // user name
0052    TString        fPw;      // user passwd
0053    TString        fOptions; // options specified
0054    Int_t          fPort;    // port to which we are connected
0055 
0056 public:
0057    TGrid() : fGridUrl(), fGrid(), fHost(), fUser(), fPw(), fOptions(), fPort(-1) {}
0058    virtual ~TGrid() {}
0059 
0060    const char    *GridUrl() const { return fGridUrl; }
0061    const char    *GetGrid() const { return fGrid; }
0062    const char    *GetHost() const { return fHost; }
0063    const char    *GetUser() const { return fUser; }
0064    const char    *GetPw() const { return fPw; }
0065    const char    *GetOptions() const { return fOptions; }
0066    Int_t          GetPort() const { return fPort; }
0067    virtual Bool_t IsConnected() const { return fPort == -1 ? kFALSE : kTRUE; }
0068 
0069    virtual void Shell() { MayNotUse("Shell"); }
0070    virtual void Stdout() { MayNotUse("Stdout"); }
0071    virtual void Stderr() { MayNotUse("Stderr"); }
0072 
0073    virtual TGridResult *Command(const char * /*command*/,
0074                                 Bool_t /*interactive*/ = kFALSE,
0075                                 UInt_t /*stream*/ = 2)
0076       { MayNotUse("Command"); return nullptr; }
0077 
0078    virtual TGridResult *Query(const char * /*path*/, const char * /*pattern*/,
0079                               const char * /*conditions*/ = "", const char * /*options*/ = "")
0080       { MayNotUse("Query"); return nullptr; }
0081 
0082    virtual TGridResult *LocateSites() { MayNotUse("LocalSites"); return nullptr; }
0083 
0084    //--- Catalogue Interface
0085    virtual TGridResult *Ls(const char* /*ldn*/ ="", Option_t* /*options*/ ="", Bool_t /*verbose*/ =kFALSE)
0086       { MayNotUse("Ls"); return nullptr; }
0087    virtual const char  *Pwd(Bool_t /*verbose*/ =kFALSE)
0088       { MayNotUse("Pwd"); return nullptr; }
0089    virtual const char  *GetHomeDirectory()
0090       { MayNotUse("GetHomeDirectory"); return nullptr; }
0091    virtual Bool_t Cd(const char* /*ldn*/ ="",Bool_t /*verbose*/ =kFALSE)
0092       { MayNotUse("Cd"); return kFALSE; }
0093    virtual Int_t  Mkdir(const char* /*ldn*/ ="", Option_t* /*options*/ ="", Bool_t /*verbose*/ =kFALSE)
0094       { MayNotUse("Mkdir"); return kFALSE; }
0095    virtual Bool_t Rmdir(const char* /*ldn*/ ="", Option_t* /*options*/ ="", Bool_t /*verbose*/ =kFALSE)
0096       { MayNotUse("Mkdir"); return kFALSE; }
0097    virtual Bool_t Register(const char* /*lfn*/ , const char* /*turl*/ , Long_t /*size*/ =-1, const char* /*se*/ =nullptr, const char* /*guid*/ =nullptr, Bool_t /*verbose*/ =kFALSE)
0098       { MayNotUse("Mkdir"); return kFALSE; }
0099    virtual Bool_t Rm(const char* /*lfn*/ , Option_t* /*option*/ ="", Bool_t /*verbose*/ =kFALSE)
0100       { MayNotUse("Mkdir"); return kFALSE; }
0101 
0102    //--- Job Submission Interface
0103    virtual TGridJob *Submit(const char * /*jdl*/)
0104       { MayNotUse("Submit"); return nullptr; }
0105    virtual TGridJDL *GetJDLGenerator()
0106       { MayNotUse("GetJDLGenerator"); return nullptr; }
0107    virtual TGridCollection *OpenCollection(const char *, UInt_t /*maxentries*/ = 1000000)
0108       { MayNotUse("OpenCollection"); return nullptr; }
0109    virtual TGridCollection *OpenCollectionQuery(TGridResult * /*queryresult*/,Bool_t /*nogrouping*/ = kFALSE)
0110       { MayNotUse("OpenCollection"); return nullptr; }
0111    virtual TGridJobStatusList* Ps(const char* /*options*/, Bool_t /*verbose*/ = kTRUE)
0112       { MayNotUse("Ps"); return nullptr; }
0113    virtual Bool_t KillById(TString /*jobid*/)
0114       { MayNotUse("KillById"); return kFALSE; }
0115    virtual Bool_t ResubmitById(TString /*jobid*/)
0116       { MayNotUse("ResubmitById"); return kFALSE; }
0117    virtual Bool_t Kill(TGridJob *gridjob)
0118       { return ((gridjob)?KillById(gridjob->GetJobID()):kFALSE); }
0119    virtual Bool_t Resubmit(TGridJob* gridjob)
0120       { return ((gridjob)?ResubmitById(gridjob->GetJobID()):kFALSE); }
0121 
0122    //--- Load desired plugin and setup conection to GRID
0123    static TGrid *Connect(const char *grid, const char *uid = nullptr,
0124                          const char *pw = nullptr, const char *options = nullptr);
0125 
0126    ClassDefOverride(TGrid,0)  // ABC defining interface to GRID services
0127 };
0128 
0129 R__EXTERN TGrid *gGrid;
0130 
0131 } // namespace ROOT::Deprecated
0132 
0133 using TGrid R__DEPRECATED(6, 42, "TGrid is expected to be unused and thus deprecated") = ROOT::Deprecated::TGrid;
0134 R__EXTERN ROOT::Deprecated::TGrid *&gGrid R__DEPRECATED(6, 42, "gGrid is expected to be unused and thus deprecated");
0135 
0136 #endif