#include <XrdCmsPList.hh>
Definition at line 95 of file XrdCmsPList.hh.
◆ XrdCmsPList_Anchor()
XrdCmsPList_Anchor::XrdCmsPList_Anchor |
( |
| ) |
|
|
inline |
◆ ~XrdCmsPList_Anchor()
XrdCmsPList_Anchor::~XrdCmsPList_Anchor |
( |
| ) |
|
|
inline |
◆ Add()
int XrdCmsPList_Anchor::Add |
( |
const char * | pname, |
|
|
XrdCmsPInfo * | pinfo ) |
Definition at line 41 of file XrdCmsPList.cc.
42{
43 int plen = strlen(pname);
44 XrdCmsPList *p, *pp;
45
46
47
49 p = next;
50 pp = 0;
51
52
53
54 while(p && p->pathlen >= plen)
55 {if (p->pathlen == plen && !strcmp(p->pathname,pname))
57 pp = p;
58 p = p->next;
59 }
60
61
62
63 p = new XrdCmsPList(pname, pinfo);
64 if (pp) { p->next = pp->next; pp->next = p;}
65 else { p->next = next; next = p;}
66
67
68
70 return 1;
71}
References Lock(), and UnLock().
◆ Empty()
void XrdCmsPList_Anchor::Empty |
( |
XrdCmsPList * | newlist = 0 | ) |
|
|
inline |
◆ Find()
int XrdCmsPList_Anchor::Find |
( |
const char * | pname, |
|
|
XrdCmsPInfo & | masks ) |
Definition at line 77 of file XrdCmsPList.cc.
78{
79 int plen = strlen(pname);
80
81
82
84 XrdCmsPList *p = next;
85
86
87
88 while(p) if (p->pathlen <= plen && !strncmp(p->pathname, pname, p->pathlen))
89 {pinfo = p->pathmask; break;}
90 else p = p->next;
91
92
93
95 return p != 0;
96}
References Lock(), and UnLock().
◆ First()
◆ Insert()
Definition at line 102 of file XrdCmsPList.cc.
103{
104 int rc, plen = strlen(pname);
105 XrdCmsPList *p, *pp;
107
108
109
111 p = next;
112 pp = 0;
113
114
115
116
117 rc = 1;
118 while(p && p->pathlen >= plen)
119 {if (p->pathlen == plen && !(rc = strcmp(p->pathname,pname))) break;
120 else if (!strncmp(p->pathname,pname,plen)
122 {p->pathmask.
And(~(pinfo->
rovec)); p->pathmask.
Or(pinfo);}
123 pp = p;
124 p = p->next;
125 }
126
127
128
129
130 if (!rc) {p->pathmask.
And(~(pinfo->
rovec)); p->pathmask.
Or(pinfo);}
131 else { p = new XrdCmsPList(pname, pinfo);
132 if (pp)
133 { p->next = pp->next;
134 pp->next = p;
135 } else {
136 p->next = next;
137 next = p;
138 }
139 pp = p->next;
140 while(pp) {if (pp->pathlen < plen
141 && !strncmp(pp->pathname,pname,pp->pathlen))
142 p->pathmask.
Or(&(pp->pathmask));
143 pp = pp->next;
144 }
145 }
146
147
148
149 newmask = p->pathmask.
rovec | p->pathmask.
rwvec;
151 return newmask;
152}
unsigned long long SMask_t
int And(const SMask_t mask)
void Or(const XrdCmsPInfo *pi)
References XrdCmsPInfo::And(), Lock(), XrdCmsPInfo::Or(), XrdCmsPInfo::rovec, XrdCmsPInfo::rwvec, and UnLock().
◆ Lock()
void XrdCmsPList_Anchor::Lock |
( |
| ) |
|
|
inline |
◆ NotEmpty()
int XrdCmsPList_Anchor::NotEmpty |
( |
| ) |
|
|
inline |
◆ Remove()
void XrdCmsPList_Anchor::Remove |
( |
SMask_t | mask | ) |
|
Definition at line 158 of file XrdCmsPList.cc.
159{
161 XrdCmsPList *pp = next, *prevp = 0;
162
163
164
166
167
168
169 while(pp)
170 {
if (!pp->pathmask.
And(zmask))
171 {if (prevp) {prevp->next = pp->next; delete pp; pp = prevp->next;}
172 else { next = pp->next; delete pp; pp = next;}
173 }
174 else {prevp = pp; pp = pp->next;}
175 }
176
177
178
180}
References XrdCmsPInfo::And(), Lock(), and UnLock().
◆ Type()
const char * XrdCmsPList_Anchor::Type |
( |
const char * | pname | ) |
|
Definition at line 186 of file XrdCmsPList.cc.
187{
188 int isrw = 0, plen = strlen(pname);
189
190
191
193 XrdCmsPList *p = next;
194
195
196
197 while(p) if (p->pathlen <= plen && !strncmp(p->pathname, pname, p->pathlen))
198 {isrw = (p->pathmask.
rwvec != 0);
break;}
199 else p = p->next;
200
201
202
204 if (p) return (isrw ? "w" : "r");
205 return "?";
206}
References Lock(), XrdCmsPInfo::rwvec, and UnLock().
◆ UnLock()
void XrdCmsPList_Anchor::UnLock |
( |
| ) |
|
|
inline |
◆ Zorch()
The documentation for this class was generated from the following files: