00001 // @(#)root/proofd:$Id: XrdProofdConfig.h 36520 2010-11-05 16:08:23Z ganis $ 00002 // Author: G. Ganis Jan 2008 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_XrdProofdConfig 00013 #define ROOT_XrdProofdConfig 00014 00015 ////////////////////////////////////////////////////////////////////////// 00016 // // 00017 // XrdProofdConfig // 00018 // // 00019 // Author: G. Ganis, CERN, 2008 // 00020 // // 00021 // Template to parse config directives // 00022 // // 00023 ////////////////////////////////////////////////////////////////////////// 00024 00025 #include "XrdOuc/XrdOucHash.hh" 00026 00027 #include "XrdProofdAux.h" 00028 00029 class XrdSysError; 00030 00031 class XrdProofdConfig { 00032 00033 private: 00034 XrdProofdFile fCfgFile; // Config file 00035 XrdOucHash<XrdProofdDirective> fDirectives; // Registered directives 00036 00037 static XrdOucString fgHost; 00038 00039 protected: 00040 XrdSysError *fEDest; 00041 00042 int ParseFile(bool rcf = false); 00043 bool ReadFile(bool update = true); 00044 void Register(const char *dname, XrdProofdDirective *d) 00045 { fDirectives.Add(dname, d); } 00046 public: 00047 XrdProofdConfig(const char *cfg = 0, XrdSysError *edest = 0); 00048 virtual ~XrdProofdConfig() { } 00049 00050 void SetCfgEDest(const char *cfg, XrdSysError *edest); 00051 const char *CfgFile() const { return fCfgFile.fName.c_str(); } 00052 00053 virtual int Config(bool rcf = 0) { return ParseFile(rcf); } 00054 virtual int DoDirective(XrdProofdDirective *, char *, 00055 XrdOucStream *, bool) { return 0; } 00056 virtual void RegisterDirectives() { } 00057 }; 00058 00059 #endif