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 <string.h>
34 
35 #include "XrdCms/XrdCmsNode.hh"
36 #include "XrdCms/XrdCmsTypes.hh"
37 #include "XrdSys/XrdSysPthread.hh"
38 
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 
58 
59 private:
60 
63 int Hwm;
64 };
65 
66 namespace XrdCms
67 {
68 extern XrdCmsRTable RTable;
69 }
70 #endif
XrdCmsRTable::Find
XrdCmsNode * Find(short Num, int Inst)
XrdSysMutex
Definition: XrdSysPthread.hh:166
XrdSysPthread.hh
XrdCmsRTable::UnLock
void UnLock()
Definition: XrdCmsRTable.hh:53
XrdCmsRTable::Add
short Add(XrdCmsNode *nP)
XrdCmsRTable::Rtable
XrdCmsNode * Rtable[maxRD]
Definition: XrdCmsRTable.hh:62
XrdCmsRTable
Definition: XrdCmsRTable.hh:40
XrdCmsNode
Definition: XrdCmsNode.hh:57
XrdCmsRTable::XrdCmsRTable
XrdCmsRTable()
Definition: XrdCmsRTable.hh:55
XrdCmsRTable::myMutex
XrdSysMutex myMutex
Definition: XrdCmsRTable.hh:61
XrdCmsRTable::~XrdCmsRTable
~XrdCmsRTable()
Definition: XrdCmsRTable.hh:57
XrdCms::RTable
XrdCmsRTable RTable
XrdCms
Definition: YProtocol.hh:78
XrdCmsRTable::Lock
void Lock()
Definition: XrdCmsRTable.hh:51
maxRD
#define maxRD
Definition: XrdCmsTypes.hh:44
XrdCmsRTable::Send
void Send(const char *What, const char *data, int dlen)
XrdCmsNode.hh
XrdSysMutex::UnLock
void UnLock()
Definition: XrdSysPthread.hh:222
XrdSysMutex::Lock
void Lock()
Definition: XrdSysPthread.hh:220
XrdCmsRTable::Hwm
int Hwm
Definition: XrdCmsRTable.hh:63
XrdCmsTypes.hh
XrdCmsRTable::Del
void Del(XrdCmsNode *nP)