XRootD
XrdCmsRTable.hh
Go to the documentation of this file.
1
#ifndef __XRDCMSRTABLE_HH_
2
#define __XRDCMSRTABLE_HH_
3
/******************************************************************************/
4
/* */
5
/* X r d C m s R T a b l 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 <cstring>
34
35
#include "
XrdCms/XrdCmsNode.hh
"
36
#include "
XrdCms/XrdCmsTypes.hh
"
37
#include "
XrdSys/XrdSysPthread.hh
"
38
39
class
XrdCmsRTable
40
{
41
public
:
42
43
short
Add
(
XrdCmsNode
*nP);
44
45
void
Del
(
XrdCmsNode
*nP);
46
47
XrdCmsNode
*
Find
(
short
Num,
int
Inst);
48
49
void
Send
(
const
char
*What,
const
char
*data,
int
dlen);
50
51
void
Lock
() {myMutex.
Lock
();}
52
53
void
UnLock
() {myMutex.
UnLock
();}
54
55
XrdCmsRTable
() {memset(Rtable, 0,
sizeof
(Rtable)); Hwm = -1;}
56
57
~XrdCmsRTable
() {}
58
59
private
:
60
61
XrdSysMutex
myMutex;
62
XrdCmsNode
*Rtable[
maxRD
];
63
int
Hwm;
64
};
65
66
namespace
XrdCms
67
{
68
extern
XrdCmsRTable
RTable
;
69
}
70
#endif
XrdCmsNode.hh
XrdCmsTypes.hh
maxRD
#define maxRD
Definition:
XrdCmsTypes.hh:44
XrdSysPthread.hh
XrdCmsNode
Definition:
XrdCmsNode.hh:58
XrdCmsRTable
Definition:
XrdCmsRTable.hh:40
XrdCmsRTable::Lock
void Lock()
Definition:
XrdCmsRTable.hh:51
XrdCmsRTable::~XrdCmsRTable
~XrdCmsRTable()
Definition:
XrdCmsRTable.hh:57
XrdCmsRTable::XrdCmsRTable
XrdCmsRTable()
Definition:
XrdCmsRTable.hh:55
XrdCmsRTable::Add
short Add(XrdCmsNode *nP)
Definition:
XrdCmsRTable.cc:46
XrdCmsRTable::Del
void Del(XrdCmsNode *nP)
Definition:
XrdCmsRTable.cc:72
XrdCmsRTable::Find
XrdCmsNode * Find(short Num, int Inst)
Definition:
XrdCmsRTable.cc:101
XrdCmsRTable::UnLock
void UnLock()
Definition:
XrdCmsRTable.hh:53
XrdCmsRTable::Send
void Send(const char *What, const char *data, int dlen)
Definition:
XrdCmsRTable.cc:115
XrdSysMutex
Definition:
XrdSysPthread.hh:165
XrdSysMutex::Lock
void Lock()
Definition:
XrdSysPthread.hh:222
XrdSysMutex::UnLock
void UnLock()
Definition:
XrdSysPthread.hh:224
XrdCms
Definition:
YProtocol.hh:78
XrdCms::RTable
XrdCmsRTable RTable
Definition:
XrdCmsRTable.cc:40
XrdCms
XrdCmsRTable.hh
Generated by
1.9.1