00001 #ifndef __CMS_MANLIST__H 00002 #define __CMS_MANLIST__H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d C m s M a n L i s t . h h */ 00006 /* */ 00007 /* (c) 2007 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 #include "XrdSys/XrdSysPthread.hh" 00014 00015 // $Id: XrdCmsManList.hh 24468 2008-06-22 16:47:03Z ganis $ 00016 00017 class XrdCmsManRef; 00018 00019 class XrdCmsManList 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 XrdCmsManList() {allMans = nextMan = 0;} 00041 ~XrdCmsManList(); 00042 00043 private: 00044 00045 XrdSysMutex mlMutex; 00046 XrdCmsManRef *nextMan; 00047 XrdCmsManRef *allMans; 00048 }; 00049 00050 namespace XrdCms 00051 { 00052 extern XrdCmsManList myMans; 00053 } 00054 #endif