XRootD
Loading...
Searching...
No Matches
XrdOucNList_Anchor Class Reference

#include <XrdOucNList.hh>

+ Inheritance diagram for XrdOucNList_Anchor:
+ Collaboration diagram for XrdOucNList_Anchor:

Public Member Functions

void Empty (XrdOucNList *newlist=0)
 
XrdOucNListFind (const char *name)
 
XrdOucNListFirst ()
 
void Insert (XrdOucNList *newitem)
 
void Lock ()
 
int NotEmpty ()
 
XrdOucNListPop ()
 
void Replace (const char *name, int nval)
 
void Replace (XrdOucNList *item)
 
void Swap (XrdOucNList_Anchor &other)
 
void UnLock ()
 
void Zorch (XrdOucNList *newnext=0)
 
- Public Member Functions inherited from XrdOucNList
 XrdOucNList (const char *name="", int nvals=0)
 
 ~XrdOucNList ()
 
int Flag ()
 
int NameKO (const char *pd)
 
int NameKO (const char *pd, const int pl)
 
int NameOK (const char *pd)
 
int NameOK (const char *pd, const int pl)
 
XrdOucNListNext ()
 
void Set (int fval)
 

Detailed Description

Definition at line 74 of file XrdOucNList.hh.

Member Function Documentation

◆ Empty()

void XrdOucNList_Anchor::Empty ( XrdOucNList newlist = 0)
inline

Definition at line 81 of file XrdOucNList.hh.

82 {Lock();
83 XrdOucNList *p = next;
84 while(p) {next = p->next; delete p; p = next;}
85 next = newlist;
86 UnLock();
87 }

References Lock(), and UnLock().

+ Here is the call graph for this function:

◆ Find()

XrdOucNList * XrdOucNList_Anchor::Find ( const char *  name)
inline

Definition at line 89 of file XrdOucNList.hh.

90 {int nlen = strlen(name);
91 Lock();
92 XrdOucNList *p = next;
93 while(p) {if (p->NameOK(name, nlen)) break;
94 p=p->next;
95 }
96 UnLock();
97 return p;
98 }
int NameOK(const char *pd, const int pl)

References Lock(), XrdOucNList::NameOK(), and UnLock().

Referenced by XrdNetSecurity::Authorize(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ First()

XrdOucNList * XrdOucNList_Anchor::First ( )
inline

Definition at line 100 of file XrdOucNList.hh.

100{return next;}

Referenced by main(), and Swap().

+ Here is the caller graph for this function:

◆ Insert()

void XrdOucNList_Anchor::Insert ( XrdOucNList newitem)
inline

Definition at line 102 of file XrdOucNList.hh.

103 {Lock();
104 newitem->next = next; next = newitem;
105 UnLock();
106 }

References Lock(), and UnLock().

Referenced by XrdNetSecurity::AddHost().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Lock()

void XrdOucNList_Anchor::Lock ( )
inline

Definition at line 78 of file XrdOucNList.hh.

78{mutex.Lock();}

References XrdSysMutex::Lock().

Referenced by Empty(), Find(), Insert(), Pop(), and Replace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotEmpty()

int XrdOucNList_Anchor::NotEmpty ( )
inline

Definition at line 108 of file XrdOucNList.hh.

108{return next != 0;}

◆ Pop()

XrdOucNList * XrdOucNList_Anchor::Pop ( )
inline

Definition at line 110 of file XrdOucNList.hh.

111 {XrdOucNList *np;
112 Lock();
113 if ((np = next)) next = np->next;
114 UnLock();
115 return np;
116 }

References Lock(), and UnLock().

Referenced by XrdNetSecurity::Merge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Replace() [1/2]

void XrdOucNList_Anchor::Replace ( const char *  name,
int  nval 
)

Definition at line 110 of file XrdOucNList.cc.

111{
112 XrdOucNList *xp = new XrdOucNList(name, nval);
113
114 Replace(xp);
115}
void Replace(const char *name, int nval)

References Replace().

Referenced by main(), XrdNetSecurity::Merge(), and Replace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Replace() [2/2]

void XrdOucNList_Anchor::Replace ( XrdOucNList item)

Definition at line 118 of file XrdOucNList.cc.

119{
120 XrdOucNList *np, *pp = 0;
121
122// Lock ourselves
123//
124 Lock();
125 np = next;
126
127// Find the matching item or the place to insert the item
128//
129 while(np && np->namelenL >= xp->namelenL)
130 {if (np->namelenL == xp->namelenL
131 && np->namelenR == xp->namelenR
132 && (np->nameL && xp->nameL && !strcmp(np->nameL, xp->nameL))
133 && (np->nameR && xp->nameR && !strcmp(np->nameR, xp->nameR)))
134 {np->Set(xp->flags);
135 UnLock();
136 delete xp;
137 return;
138 }
139 pp = np; np = np->next;
140 }
141
142// Must insert a new item
143//
144 if (pp) {xp->next = np; pp->next = xp;}
145 else {xp->next = next; next = xp;}
146
147// All done
148//
149 UnLock();
150}
void Set(int fval)

References Lock(), XrdOucNList::Set(), and UnLock().

+ Here is the call graph for this function:

◆ Swap()

void XrdOucNList_Anchor::Swap ( XrdOucNList_Anchor other)
inline

Definition at line 123 of file XrdOucNList.hh.

124 {XrdOucNList *savenext = next;
125 next = other.First();
126 other.Zorch(savenext);
127 }
XrdOucNList * First()
void Zorch(XrdOucNList *newnext=0)

References First(), and Zorch().

+ Here is the call graph for this function:

◆ UnLock()

void XrdOucNList_Anchor::UnLock ( )
inline

Definition at line 79 of file XrdOucNList.hh.

79{mutex.UnLock();}

References XrdSysMutex::UnLock().

Referenced by Empty(), Find(), Insert(), Pop(), and Replace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Zorch()

void XrdOucNList_Anchor::Zorch ( XrdOucNList newnext = 0)
inline

Definition at line 129 of file XrdOucNList.hh.

129{next = newnext;}

Referenced by Swap().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: