Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
XrdProofdConfig.h
Go to the documentation of this file.
1 // @(#)root/proofd:$Id$
2 // Author: G. Ganis Jan 2008
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_XrdProofdConfig
13 #define ROOT_XrdProofdConfig
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // XrdProofdConfig //
18 // //
19 // Author: G. Ganis, CERN, 2008 //
20 // //
21 // Template to parse config directives //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "XrdOuc/XrdOucHash.hh"
26 
27 #include "XrdProofdAux.h"
28 
29 class XrdSysError;
30 
31 class XrdProofdConfig {
32 
33 private:
34  XrdProofdFile fCfgFile; // Config file
35  XrdOucHash<XrdProofdDirective> fDirectives; // Registered directives
36 
37  static XrdOucString fgHost;
38 
39 protected:
40  XrdSysError *fEDest;
41 
42  int ParseFile(bool rcf = false);
43  bool ReadFile(bool update = true);
44  void Register(const char *dname, XrdProofdDirective *d)
45  { fDirectives.Add(dname, d); }
46 public:
47  XrdProofdConfig(const char *cfg = 0, XrdSysError *edest = 0);
48  virtual ~XrdProofdConfig() { }
49 
50  void SetCfgEDest(const char *cfg, XrdSysError *edest);
51  const char *CfgFile() const { return fCfgFile.fName.c_str(); }
52 
53  virtual int Config(bool rcf = 0) { return ParseFile(rcf); }
54  virtual int DoDirective(XrdProofdDirective *, char *,
55  XrdOucStream *, bool) { return 0; }
56  virtual void RegisterDirectives() { }
57 };
58 
59 #endif