00001 #ifndef __XRDOLBRTABLE_HH_ 00002 #define __XRDOLBRTABLE_HH_ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O l b R T a b l e . h h */ 00006 /* */ 00007 /* (c) 2006 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdOlbRTable.hh,v 1.4 2007/07/26 15:18:25 ganis Exp $ 00014 00015 #include <string.h> 00016 00017 #include "XrdOlb/XrdOlbServer.hh" 00018 #include "XrdSys/XrdSysPthread.hh" 00019 00020 class XrdOlbRTable 00021 { 00022 public: 00023 00024 short Add(XrdOlbServer *sp); 00025 00026 void Del(XrdOlbServer *sp); 00027 00028 XrdOlbServer *Find(short Num, int Inst); 00029 00030 void Lock() {myMutex.Lock();} 00031 00032 void UnLock() {myMutex.UnLock();} 00033 00034 XrdOlbRTable() {memset(Rtable, 0, sizeof(Rtable)); Hwm = -1;} 00035 00036 ~XrdOlbRTable() {} 00037 00038 private: 00039 00040 static const int maxRD = 65; // slot 0 is never used. 00041 00042 XrdSysMutex myMutex; 00043 XrdOlbServer *Rtable[maxRD]; 00044 int Hwm; 00045 }; 00046 00047 namespace XrdOlb 00048 { 00049 extern XrdOlbRTable RTable; 00050 } 00051 #endif
1.7.1