Logo ROOT   6.10/09
Reference Guide
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 
32 
33 private:
34  XrdProofdFile fCfgFile; // Config file
35  XrdOucHash<XrdProofdDirective> fDirectives; // Registered directives
36 
37  static XrdOucString fgHost;
38 
39 protected:
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
XrdProofdConfig(const char *cfg=0, XrdSysError *edest=0)
Main constructor.
XrdOucString fName
Definition: XrdProofdAux.h:76
virtual ~XrdProofdConfig()
virtual void RegisterDirectives()
XrdSysError * fEDest
virtual int DoDirective(XrdProofdDirective *, char *, XrdOucStream *, bool)
XrdOucHash< XrdProofdDirective > fDirectives
#define XrdSysError
Definition: XpdSysError.h:8
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
void SetCfgEDest(const char *cfg, XrdSysError *edest)
Set config file and error handler.
XrdProofdFile fCfgFile
const char * CfgFile() const
int ParseFile(bool rcf=false)
Parse config file for the registered directives.
virtual int Config(bool rcf=0)
bool ReadFile(bool update=true)
Return true if the file has never been read or did change since last reading, false otherwise...
static XrdOucString fgHost
void Register(const char *dname, XrdProofdDirective *d)