Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TProofResourcesStatic.h
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Paul Nilsson 7/12/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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 #ifndef ROOT_TProofResourcesStatic
13 #define ROOT_TProofResourcesStatic
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TProofResourcesStatic //
18 // //
19 // Implementation of PROOF static resources. //
20 // The purpose of this class is to provide a standard interface to //
21 // static config files. It interprets Proof config files (proof.conf) //
22 // and sorts the contents into TProofNodeInfo objects. Master info will //
23 // be placed in fMaster (of type TProofNodeInfo). Submaster info will //
24 // be put in fSubmasterList (a TList of TProofNodeInfo objects), while //
25 // workers (and condorworkers) will be placed in fWorkerList (a TList //
26 // of TProofNodeInfo objects). //
27 // //
28 //////////////////////////////////////////////////////////////////////////
29 
30 #include "TProofResources.h"
31 #include "TString.h"
32 
33 class TList;
34 class TProofNodeInfo;
35 
36 
37 class TProofResourcesStatic : public TProofResources {
38 
39 public:
40  enum EInfoType { kNodeType, kOption, kHost };
41 
42 private:
43  TProofNodeInfo *fMaster; // Master node info
44  TList *fSubmasterList; // Node info list with all submasters
45  TList *fWorkerList; // Node info list with all workers
46  Bool_t fFoundMaster; // kTRUE if config file has master info
47  TString fFileName; // Config file name
48 
49  void InitResources();
50  Bool_t ReadConfigFile(const char *confDir, const char *fileName);
51 
52  static EInfoType GetInfoType(const TString &word);
53  static void SetOption(TProofNodeInfo *nodeinfo, const TString &option,
54  const TString &value);
55  static TProofNodeInfo *CreateNodeInfo(const TString &name);
56 
57 public:
58  TProofResourcesStatic();
59  TProofResourcesStatic(const char *confDir, const char *fileName);
60  virtual ~TProofResourcesStatic();
61 
62  TProofNodeInfo *GetMaster();
63  TList *GetSubmasters();
64  TList *GetWorkers();
65  TString GetFileName() const { return fFileName; }
66 
67  ClassDef(TProofResourcesStatic,0) // Class to handle PROOF static config
68 };
69 
70 #endif
71