xrootd
XrdCmsManager.hh
Go to the documentation of this file.
1 #ifndef __CMS_MANAGER__H
2 #define __CMS_MANAGER__H
3 /******************************************************************************/
4 /* */
5 /* X r d C m s M a n a g e r . 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 <stdlib.h>
16 #include <string.h>
17 #include <strings.h>
18 
19 #include "XProtocol/YProtocol.hh"
20 
21 #include "XrdCms/XrdCmsManList.hh"
22 #include "XrdCms/XrdCmsTypes.hh"
23 #include "XrdSys/XrdSysPthread.hh"
24 
25 class XrdLink;
26 class XrdCmsDrop;
27 class XrdCmsNode;
28 class XrdCmsServer;
29 
30 /******************************************************************************/
31 /* C l a s s X r d C m s M a n a g e r */
32 /******************************************************************************/
33 
34 // This a single-instance global class
35 //
37 {
38 public:
39 
40 static const int MTMax = 16; // Maximum number of Managers
41 
42 XrdCmsNode *Add(XrdLink *lp, int Lvl);
43 
44 void Inform(const char *What, const char *Data, int Dlen);
45 void Inform(const char *What, struct iovec *vP, int vN, int vT=0);
46 void Inform(XrdCms::CmsReqCode rCode, int rMod, const char *Arg=0, int Alen=0);
47 void Inform(XrdCms::CmsRRHdr &Hdr, const char *Arg=0, int Alen=0);
48 
49 int Present() {return MTHi >= 0;};
50 
51 void Remove(XrdCmsNode *nP, const char *reason=0);
52 
53 void Reset();
54 
55  XrdCmsManager();
56  ~XrdCmsManager() {} // This object should never be deleted
57 
58 private:
59 
62 
63 int MTHi;
64 };
65 
66 namespace XrdCms
67 {
68 extern XrdCmsManager Manager;
69 }
70 #endif