xrootd
XrdSutBuckList.hh
Go to the documentation of this file.
1 #ifndef __SUT_BUCKLIST_H__
2 #define __SUT_BUCKLIST_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S u t B u c k L i s t . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Gerri Ganis for CERN */
9 /* */
10 /* This file is part of the XRootD software suite. */
11 /* */
12 /* XRootD is free software: you can redistribute it and/or modify it under */
13 /* the terms of the GNU Lesser General Public License as published by the */
14 /* Free Software Foundation, either version 3 of the License, or (at your */
15 /* option) any later version. */
16 /* */
17 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
18 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
20 /* License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
24 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
25 /* */
26 /* The copyright holder's institutional names and contributor's names may not */
27 /* be used to endorse or promote products derived from this software without */
28 /* specific prior written permission of the institution or contributor. */
29 /******************************************************************************/
30 
31 #ifndef __SUT_BUCKET_H__
32 #include "XrdSut/XrdSutBucket.hh"
33 #endif
34 
35 /******************************************************************************/
36 /* */
37 /* Light single-linked list for managing buckets inside the exchanged */
38 /* buffer */
39 /* */
40 /******************************************************************************/
41 
42 //
43 // Node definition
44 //
46 private:
49 public:
51  { buck = b; next = n;}
52  virtual ~XrdSutBuckListNode() { }
53 
54  XrdSutBucket *Buck() const { return buck; }
55 
56  XrdSutBuckListNode *Next() const { return next; }
57 
58  void SetNext(XrdSutBuckListNode *n) { next = n; }
59 };
60 
62 
63 private:
68  int size;
69 
71 
72 public:
74  virtual ~XrdSutBuckList();
75 
76  // Access information
77  int Size() const { return size; }
78  XrdSutBucket *End() const { return end->Buck(); }
79 
80  // Modifiers
81  void PutInFront(XrdSutBucket *b);
82  void PushBack(XrdSutBucket *b);
83  void Remove(XrdSutBucket *b);
84 
85  // Pseudo - iterator functionality
87  XrdSutBucket *Next();
88 };
89 
90 #endif
91 
void PutInFront(XrdSutBucket *b)
XrdSutBuckList(XrdSutBucket *b=0)
virtual ~XrdSutBuckListNode()
Definition: XrdSutBuckList.hh:52
XrdSutBuckListNode * Find(XrdSutBucket *b)
XrdSutBucket * Next()
XrdSutBucket * buck
Definition: XrdSutBuckList.hh:47
XrdSutBuckListNode * begin
Definition: XrdSutBuckList.hh:64
void PushBack(XrdSutBucket *b)
XrdSutBucket * Buck() const
Definition: XrdSutBuckList.hh:54
void Remove(XrdSutBucket *b)
XrdSutBuckListNode * current
Definition: XrdSutBuckList.hh:65
int Size() const
Definition: XrdSutBuckList.hh:77
XrdSutBuckListNode * end
Definition: XrdSutBuckList.hh:66
XrdSutBuckListNode * next
Definition: XrdSutBuckList.hh:48
XrdSutBucket * End() const
Definition: XrdSutBuckList.hh:78
XrdSutBuckListNode(XrdSutBucket *b=0, XrdSutBuckListNode *n=0)
Definition: XrdSutBuckList.hh:50
XrdSutBuckListNode * Next() const
Definition: XrdSutBuckList.hh:56
XrdSutBuckListNode * previous
Definition: XrdSutBuckList.hh:67
int size
Definition: XrdSutBuckList.hh:68
Definition: XrdSutBuckList.hh:45
Definition: XrdSutBucket.hh:43
void SetNext(XrdSutBuckListNode *n)
Definition: XrdSutBuckList.hh:58
XrdSutBucket * Begin()
virtual ~XrdSutBuckList()
Definition: XrdSutBuckList.hh:61