xrootd
XrdSutBuckList.hh
Go to the documentation of this file.
1 // $Id$
2 #ifndef __SUT_BUCKLIST_H__
3 #define __SUT_BUCKLIST_H__
4 /******************************************************************************/
5 /* */
6 /* X r d S u t B u c k L i s t . h h */
7 /* */
8 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
9 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
10 /* Produced by Andrew Hanushevsky for Stanford University under contract */
11 /* DE-AC03-76-SFO0515 with the Department of Energy */
12 /******************************************************************************/
13 
14 #ifndef __SUT_BUCKET_H__
15 #include <XrdSut/XrdSutBucket.hh>
16 #endif
17 
18 /******************************************************************************/
19 /* */
20 /* Light single-linked list for managing buckets inside the exchanged */
21 /* buffer */
22 /* */
23 /******************************************************************************/
24 
25 //
26 // Node definition
27 //
29 private:
32 public:
34  { buck = b; next = n;}
35  virtual ~XrdSutBuckListNode() { }
36 
37  XrdSutBucket *Buck() const { return buck; }
38 
39  XrdSutBuckListNode *Next() const { return next; }
40 
41  void SetNext(XrdSutBuckListNode *n) { next = n; }
42 };
43 
45 
46 private:
51  int size;
52 
54 
55 public:
57  virtual ~XrdSutBuckList();
58 
59  // Access information
60  int Size() const { return size; }
61  XrdSutBucket *End() const { return end->Buck(); }
62 
63  // Modifiers
64  void PutInFront(XrdSutBucket *b);
65  void PushBack(XrdSutBucket *b);
66  void Remove(XrdSutBucket *b);
67 
68  // Pseudo - iterator functionality
70  XrdSutBucket *Next();
71 };
72 
73 #endif
74