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
/* This file is part of the XRootD software suite. */
13
/* */
14
/* XRootD is free software: you can redistribute it and/or modify it under */
15
/* the terms of the GNU Lesser General Public License as published by the */
16
/* Free Software Foundation, either version 3 of the License, or (at your */
17
/* option) any later version. */
18
/* */
19
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22
/* License for more details. */
23
/* */
24
/* You should have received a copy of the GNU Lesser General Public License */
25
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27
/* */
28
/* The copyright holder's institutional names and contributor's names may not */
29
/* be used to endorse or promote products derived from this software without */
30
/* specific prior written permission of the institution or contributor. */
31
/******************************************************************************/
32
33
#include "
XrdCms/XrdCmsManager.hh
"
34
#include "
XrdSys/XrdSysPthread.hh
"
35
36
class
XrdCmsNode
;
37
38
class
XrdCmsManTree
39
{
40
public
:
41
42
void
Abort
();
43
44
int
Connect
(
int
nID,
XrdCmsNode
*nP);
45
46
void
Disc
(
int
nID);
47
48
int
Register
();
49
50
int
Trying
(
int
nID,
int
Lvl);
51
52
enum
connStat
{
Aborted
,
Active
,
Connected
,
None
,
Pending
,
Waiting
};
53
54
XrdCmsManTree
(
int
maxC);
55
~XrdCmsManTree
() {};
56
57
private
:
58
59
void
Redrive(
int
nID) {tmInfo[nID].Status =
Active
;
60
tmInfo[nID].theSem.Post();
61
numWaiting--;
62
}
63
void
Pause(
int
nID) {tmInfo[nID].Status =
Waiting
;
64
numWaiting++;
65
myMutex.
UnLock
();
66
tmInfo[nID].theSem.Wait();
67
}
68
69
XrdSysMutex
myMutex;
70
71
72
struct
TreeInfo
73
{
XrdSysSemaphore
theSem;
74
XrdCmsNode
*nodeP;
75
connStat
Status;
76
int
Level;
77
78
TreeInfo() : theSem(0), nodeP(0), Status(
None
), Level(0) {};
79
~TreeInfo() {};
80
81
} tmInfo[
XrdCmsManager::MTMax
];
82
83
char
buff[16];
84
int
maxTMI;
85
int
numConn;
86
int
maxConn;
87
int
atRoot;
88
int
conLevel;
89
int
conNID;
90
int
numWaiting;
91
connStat
myStatus;
92
};
93
#endif
XrdCmsManager.hh
XrdSysPthread.hh
XrdCmsManTree
Definition:
XrdCmsManTree.hh:39
XrdCmsManTree::Connect
int Connect(int nID, XrdCmsNode *nP)
Definition:
XrdCmsManTree.cc:78
XrdCmsManTree::Abort
void Abort()
Definition:
XrdCmsManTree.cc:56
XrdCmsManTree::Register
int Register()
Definition:
XrdCmsManTree.cc:151
XrdCmsManTree::connStat
connStat
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Active
@ Active
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Waiting
@ Waiting
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Pending
@ Pending
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::None
@ None
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Aborted
@ Aborted
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Connected
@ Connected
Definition:
XrdCmsManTree.hh:52
XrdCmsManTree::Disc
void Disc(int nID)
Definition:
XrdCmsManTree.cc:133
XrdCmsManTree::XrdCmsManTree
XrdCmsManTree(int maxC)
Definition:
XrdCmsManTree.cc:45
XrdCmsManTree::~XrdCmsManTree
~XrdCmsManTree()
Definition:
XrdCmsManTree.hh:55
XrdCmsManTree::Trying
int Trying(int nID, int Lvl)
Definition:
XrdCmsManTree.cc:178
XrdCmsManager::MTMax
static const int MTMax
Definition:
XrdCmsManager.hh:63
XrdCmsNode
Definition:
XrdCmsNode.hh:58
XrdSysMutex
Definition:
XrdSysPthread.hh:165
XrdSysMutex::UnLock
void UnLock()
Definition:
XrdSysPthread.hh:224
XrdSysSemaphore
Definition:
XrdSysPthread.hh:494
XrdCms
XrdCmsManTree.hh
Generated by
1.9.1