xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdCms
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
20
class
XrdCmsManTree
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
34
enum
connStat
{
Active
,
Connected
,
None
,
Pending
,
Waiting
};
35
36
XrdCmsManTree
() :
maxTMI
(0),
numConn
(0),
maxConn
(0),
atRoot
(0),
37
conLevel
(0),
conNID
(-1),
numWaiting
(0),
38
myStatus
(
Active
) {};
39
~XrdCmsManTree
() {};
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
53
XrdSysMutex
myMutex
;
54
55
56
struct
TreeInfo
57
{
XrdSysSemaphore
theSem
;
58
XrdCmsNode
*
nodeP
;
59
connStat
Status
;
60
int
Level
;
61
62
TreeInfo
() :
theSem
(0),
nodeP
(0),
Status
(
None
),
Level
(0) {};
63
~TreeInfo
() {};
64
65
}
tmInfo
[
XrdCmsManager::MTMax
];
66
67
char
buff
[8];
68
int
maxTMI
;
69
int
numConn
;
70
int
maxConn
;
71
int
atRoot
;
72
int
conLevel
;
73
int
conNID
;
74
int
numWaiting
;
75
connStat
myStatus
;
76
};
77
78
namespace
XrdCms
79
{
80
extern
XrdCmsManTree
ManTree
;
81
}
82
#endif
Generated by
1.8.1.2