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