XRootD
XrdOucDLlist< T > Class Template Reference

#include <XrdOucDLlist.hh>

+ Collaboration diagram for XrdOucDLlist< T >:

Public Member Functions

 XrdOucDLlist (T *itemval=0)
 
 ~XrdOucDLlist ()
 
T * Apply (int(*func)(T *, void *), void *Arg, XrdOucDLlist *Start=0)
 
void Insert (XrdOucDLlist *Node, T *Item=0)
 
T * Item ()
 
XrdOucDLlistNext ()
 
XrdOucDLlistPrev ()
 
void Remove ()
 
void setItem (T *ival)
 
int Singleton ()
 

Detailed Description

template<class T>
class XrdOucDLlist< T >

Definition at line 35 of file XrdOucDLlist.hh.

Constructor & Destructor Documentation

◆ XrdOucDLlist()

template<class T >
XrdOucDLlist< T >::XrdOucDLlist ( T *  itemval = 0)
inline

Definition at line 39 of file XrdOucDLlist.hh.

39 {prev=this; next=this; item=itemval;}

◆ ~XrdOucDLlist()

template<class T >
XrdOucDLlist< T >::~XrdOucDLlist ( )
inline

Definition at line 40 of file XrdOucDLlist.hh.

40 {if (prev != next) Remove();}

References XrdOucDLlist< T >::Remove().

+ Here is the call graph for this function:

Member Function Documentation

◆ Apply()

template<class T >
T* XrdOucDLlist< T >::Apply ( int(*)(T *, void *)  func,
void *  Arg,
XrdOucDLlist< T > *  Start = 0 
)
inline

Definition at line 50 of file XrdOucDLlist.hh.

51  {XrdOucDLlist *nextnode, *node;
52  if (Start) node = Start; // Set correct starting point
53  else node = this;
54 
55  // Iterate through the list until we hit ourselves again. We do the
56  // loop once on the current node to allow for anchorless lists.
57  //
58  do {nextnode = node->next;
59  if (node->item && (*func)(node->item, Arg)) return node->item;
60  node = nextnode;
61  } while (node != this);
62 
63  // All done, indicate we went through the whole list
64  //
65  return (T *)0;
66  }

◆ Insert()

template<class T >
void XrdOucDLlist< T >::Insert ( XrdOucDLlist< T > *  Node,
T *  Item = 0 
)
inline

Definition at line 71 of file XrdOucDLlist.hh.

72  {Node->next = next; // Chain in the item;
73  next->prev = Node;
74  next = Node;
75  Node->prev = this;
76  if (Item) Node->item = Item;
77  }

References XrdOucDLlist< T >::Item().

Referenced by XrdOssSys::Stage_RT().

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

◆ Item()

template<class T >
T* XrdOucDLlist< T >::Item ( )
inline

Definition at line 81 of file XrdOucDLlist.hh.

81 {return item;}

Referenced by XrdOssSys::CalcTime(), XrdOucDLlist< T >::Insert(), and XrdOssSys::Stage_In().

+ Here is the caller graph for this function:

◆ Next()

template<class T >
XrdOucDLlist* XrdOucDLlist< T >::Next ( )
inline

Definition at line 94 of file XrdOucDLlist.hh.

94 {return next;}

Referenced by XrdOssSys::CalcTime().

+ Here is the caller graph for this function:

◆ Prev()

template<class T >
XrdOucDLlist* XrdOucDLlist< T >::Prev ( )
inline

Definition at line 98 of file XrdOucDLlist.hh.

98 {return prev;}

Referenced by XrdOssSys::Stage_In().

+ Here is the caller graph for this function:

◆ Remove()

template<class T >
void XrdOucDLlist< T >::Remove ( )
inline

Definition at line 85 of file XrdOucDLlist.hh.

86  {prev->next = next; // Unchain the item
87  next->prev = prev;
88  next = this;
89  prev = this;
90  }

Referenced by XrdOssStage_Req::~XrdOssStage_Req(), XrdOucDLlist< T >::~XrdOucDLlist(), XrdCmsRRQ::Ready(), XrdCmsRRQ::Respond(), XrdOssSys::Stage_In(), and XrdCmsRRQ::TimeOut().

+ Here is the caller graph for this function:

◆ setItem()

template<class T >
void XrdOucDLlist< T >::setItem ( T *  ival)
inline

Definition at line 102 of file XrdOucDLlist.hh.

102 {item = ival;}

Referenced by XrdOssStage_Req::XrdOssStage_Req().

+ Here is the caller graph for this function:

◆ Singleton()

template<class T >
int XrdOucDLlist< T >::Singleton ( )
inline

Definition at line 106 of file XrdOucDLlist.hh.

106 {return next == this;}

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