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 }
XrdOucNList(const char *name="", int nvals=0)

References XrdOucNList::XrdOucNList(), 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 XrdOucNList::XrdOucNList(), Lock(), XrdOucNList::NameOK(), and UnLock().

Referenced by 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;}

References XrdOucNList::XrdOucNList().

Referenced by main(), and Swap().

+ Here is the call graph for this function:
+ 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 XrdOucNList::XrdOucNList(), Lock(), and UnLock().

+ Here is the call graph for this function:

◆ Lock()

void XrdOucNList_Anchor::Lock ( )
inline

Definition at line 78 of file XrdOucNList.hh.

78{mutex.Lock();}

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

+ 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 XrdOucNList::XrdOucNList(), 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 111 of file XrdOucNList.cc.

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

References XrdOucNList::XrdOucNList(), and Replace().

Referenced by main(), 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 119 of file XrdOucNList.cc.

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

References XrdOucNList::XrdOucNList(), 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 XrdOucNList::XrdOucNList(), First(), XrdOucNList::XrdOucNList_Anchor, 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();}

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

+ 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;}

References XrdOucNList::XrdOucNList().

Referenced by Swap().

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

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