// @(#)root/proof:$Id$
// Author: Paul Nilsson   7/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TProofNodeInfo
#define ROOT_TProofNodeInfo


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TProofNodeInfo                                                       //
//                                                                      //
// Implementation of PROOF node info.                                   //
// The purpose of this class is to provide a complete node description  //
// for masters, submasters and workers.                                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif

class TProofResourcesStatic;


class TProofNodeInfo : public TObject {

friend class TProofResourcesStatic;

public:
   enum ENodeType { kMaster, kSubMaster, kWorker };

private:
   ENodeType fNodeType;  // Distinction between master, submaster and worker
   TString   fName;      // Tag of the node (name:port)
   TString   fNodeName;  // Name of the node
   TString   fWorkDir;   // Working directory
   TString   fOrdinal;   // Worker ordinal number
   TString   fImage;     // File system image
   TString   fId;        // Id number
   TString   fConfig;    // Configuration file name [for submasters]
   TString   fMsd;       // Msd value [for submasters]
   Int_t     fPort;      // Port number
   Int_t     fPerfIndex; // Performance index
   Int_t     fNWrks;     // Number of workers (when kSubMaster)

   void operator=(const TProofNodeInfo &);    // idem

public:
   TProofNodeInfo();
   TProofNodeInfo(const char *str);
   TProofNodeInfo(const TProofNodeInfo &nodeInfo);
   ~TProofNodeInfo() { }

   const char    *GetName() const { return fName; }
   ENodeType      GetNodeType() const { return fNodeType; }
   const TString &GetNodeName() const { return fNodeName; }
   const TString &GetWorkDir() const { return fWorkDir; }
   const TString &GetOrdinal() const { return fOrdinal; }
   const TString &GetImage() const { return fImage; }
   const TString &GetId() const { return fId; }
   const TString &GetConfig() const { return fConfig; }
   const TString &GetMsd() const { return fMsd; }
   Int_t          GetPort() const { return fPort; }
   Int_t          GetPerfIndex() const { return fPerfIndex; }
   Int_t          GetNWrks() const { return fNWrks; }

   Bool_t         IsMaster() const { return (fNodeType == kMaster) ? kTRUE : kFALSE; }
   Bool_t         IsSubMaster() const { return (fNodeType == kSubMaster) ? kTRUE : kFALSE; }
   Bool_t         IsWorker() const { return (fNodeType == kWorker) ? kTRUE : kFALSE; }

   void           SetNodeType(ENodeType nt) { fNodeType = nt; }
   void           SetNWrks(Int_t nw) { fNWrks = nw; }

   void Assign(const TProofNodeInfo &n);

   void Print(const Option_t *) const;

   static ENodeType GetNodeType(const TString &type);

   ClassDef(TProofNodeInfo,1) // Class describing a PROOF node
};

#endif
 TProofNodeInfo.h:1
 TProofNodeInfo.h:2
 TProofNodeInfo.h:3
 TProofNodeInfo.h:4
 TProofNodeInfo.h:5
 TProofNodeInfo.h:6
 TProofNodeInfo.h:7
 TProofNodeInfo.h:8
 TProofNodeInfo.h:9
 TProofNodeInfo.h:10
 TProofNodeInfo.h:11
 TProofNodeInfo.h:12
 TProofNodeInfo.h:13
 TProofNodeInfo.h:14
 TProofNodeInfo.h:15
 TProofNodeInfo.h:16
 TProofNodeInfo.h:17
 TProofNodeInfo.h:18
 TProofNodeInfo.h:19
 TProofNodeInfo.h:20
 TProofNodeInfo.h:21
 TProofNodeInfo.h:22
 TProofNodeInfo.h:23
 TProofNodeInfo.h:24
 TProofNodeInfo.h:25
 TProofNodeInfo.h:26
 TProofNodeInfo.h:27
 TProofNodeInfo.h:28
 TProofNodeInfo.h:29
 TProofNodeInfo.h:30
 TProofNodeInfo.h:31
 TProofNodeInfo.h:32
 TProofNodeInfo.h:33
 TProofNodeInfo.h:34
 TProofNodeInfo.h:35
 TProofNodeInfo.h:36
 TProofNodeInfo.h:37
 TProofNodeInfo.h:38
 TProofNodeInfo.h:39
 TProofNodeInfo.h:40
 TProofNodeInfo.h:41
 TProofNodeInfo.h:42
 TProofNodeInfo.h:43
 TProofNodeInfo.h:44
 TProofNodeInfo.h:45
 TProofNodeInfo.h:46
 TProofNodeInfo.h:47
 TProofNodeInfo.h:48
 TProofNodeInfo.h:49
 TProofNodeInfo.h:50
 TProofNodeInfo.h:51
 TProofNodeInfo.h:52
 TProofNodeInfo.h:53
 TProofNodeInfo.h:54
 TProofNodeInfo.h:55
 TProofNodeInfo.h:56
 TProofNodeInfo.h:57
 TProofNodeInfo.h:58
 TProofNodeInfo.h:59
 TProofNodeInfo.h:60
 TProofNodeInfo.h:61
 TProofNodeInfo.h:62
 TProofNodeInfo.h:63
 TProofNodeInfo.h:64
 TProofNodeInfo.h:65
 TProofNodeInfo.h:66
 TProofNodeInfo.h:67
 TProofNodeInfo.h:68
 TProofNodeInfo.h:69
 TProofNodeInfo.h:70
 TProofNodeInfo.h:71
 TProofNodeInfo.h:72
 TProofNodeInfo.h:73
 TProofNodeInfo.h:74
 TProofNodeInfo.h:75
 TProofNodeInfo.h:76
 TProofNodeInfo.h:77
 TProofNodeInfo.h:78
 TProofNodeInfo.h:79
 TProofNodeInfo.h:80
 TProofNodeInfo.h:81
 TProofNodeInfo.h:82
 TProofNodeInfo.h:83
 TProofNodeInfo.h:84
 TProofNodeInfo.h:85
 TProofNodeInfo.h:86
 TProofNodeInfo.h:87
 TProofNodeInfo.h:88
 TProofNodeInfo.h:89
 TProofNodeInfo.h:90
 TProofNodeInfo.h:91
 TProofNodeInfo.h:92
 TProofNodeInfo.h:93
 TProofNodeInfo.h:94