00001 #ifndef __XRDCnsXref_H_
00002 #define __XRDCnsXref_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "XrdOuc/XrdOucHash.hh"
00016 #include "XrdSys/XrdSysPthread.hh"
00017
00018 class XrdCnsXref
00019 {
00020 public:
00021
00022
00023 char Add(const char *Key, char xref=0);
00024
00025 char *Apply(int (*func)(const char *, char *, void *), void *Arg)
00026 {return xTable.Apply(func, Arg);}
00027
00028 char Default(const char *Dflt=0);
00029
00030 char *Key (char xref);
00031
00032 char Find(const char *xref);
00033
00034 XrdCnsXref(const char *Dflt=0, int MTProt=1);
00035 ~XrdCnsXref();
00036
00037 private:
00038
00039 int availI();
00040 int c2i(char xCode);
00041 XrdSysMutex xMutex;
00042 XrdOucHash<char> xTable;
00043 static char *xIndex;
00044
00045 static const int yTSize = '~'-'0'+1;
00046 char *yTable[yTSize];
00047 int availIdx;
00048 int isMT;
00049 };
00050 #endif