00001 #ifndef __OLB_MANLIST__H 00002 #define __OLB_MANLIST__H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O l b M a n L i s t . h h */ 00006 /* */ 00007 /* (c) 2005 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-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 #include "XrdSys/XrdSysPthread.hh" 00014 00015 // $Id: XrdOlbManList.hh,v 1.3 2007/07/26 15:18:24 ganis Exp $ 00016 00017 class XrdOlbManRef; 00018 00019 class XrdOlbManList 00020 { 00021 public: 00022 00023 // Add() adds an alternate manager to the list of managers (duplicates not added) 00024 // 00025 void Add(unsigned int refp, char *manp, int manport, int lvl); 00026 00027 // Del() removes all entries added under refp 00028 // 00029 void Del(unsigned int refp); 00030 00031 // haveAlts() returns true if alternates exist, false otherwise 00032 // 00033 int haveAlts() {return allMans != 0;} 00034 00035 // Next() returns the next manager in the list and its level or 0 if none are left. 00036 // The next call to Next() will return the first manager in the list. 00037 // 00038 int Next(int &port, char *buff, int bsz); 00039 00040 XrdOlbManList() {allMans = nextMan = 0;} 00041 ~XrdOlbManList(); 00042 00043 private: 00044 00045 XrdSysMutex mlMutex; 00046 XrdOlbManRef *nextMan; 00047 XrdOlbManRef *allMans; 00048 }; 00049 00050 namespace XrdOlb 00051 { 00052 extern XrdOlbManList myMans; 00053 } 00054 #endif
1.7.1