xrootd
XrdCmsManTree.hh
Go to the documentation of this file.
1 #ifndef __XRDCMSMANTREE_HH_
2 #define __XRDCMSMANTREE_HH_
3 /******************************************************************************/
4 /* */
5 /* X r d C m s M a n T r e e . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include "XrdCms/XrdCmsManager.hh"
16 #include "XrdSys/XrdSysPthread.hh"
17 
18 class XrdCmsNode;
19 
21 {
22 public:
23 
24 int Connect(int nID, XrdCmsNode *nP);
25 
26 void Disc(int nID);
27 
28 int Register();
29 
30 void setMaxCon(int i);
31 
32 int Trying(int nID, int Lvl);
33 
35 
37  conLevel(0), conNID(-1), numWaiting(0),
38  myStatus(Active) {};
40 
41 private:
42 
43 void Redrive(int nID) {tmInfo[nID].Status = Active;
44  tmInfo[nID].theSem.Post();
45  numWaiting--;
46  }
47 void Pause(int nID) {tmInfo[nID].Status = Waiting;
48  numWaiting++;
49  myMutex.UnLock();
50  tmInfo[nID].theSem.Wait();
51  }
52 
54 
55 
56 struct TreeInfo
60  int Level;
61 
62  TreeInfo() : theSem(0), nodeP(0), Status(None), Level(0) {};
63  ~TreeInfo() {};
64 
66 
67 char buff[8];
68 int maxTMI;
69 int numConn;
70 int maxConn;
71 int atRoot;
73 int conNID;
76 };
77 
78 namespace XrdCms
79 {
80 extern XrdCmsManTree ManTree;
81 }
82 #endif