2 * $TOG: List_base.hh /main/5 1997/12/29 10:27:35 bill $
4 * Copyright (c) 1993 HAL Computer Systems International, Ltd.
5 * All rights reserved. Unpublished -- rights reserved under
6 * the Copyright Laws of the United States. USE OF A COPYRIGHT
7 * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
10 * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
11 * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
12 * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
13 * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
16 * RESTRICTED RIGHTS LEGEND
17 * Use, duplication, or disclosure by the Government is subject
18 * to the restrictions as set forth in subparagraph (c)(l)(ii)
19 * of the Rights in Technical Data and Computer Software clause
20 * at DFARS 252.227-7013.
22 * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
35 // Base classes for List template.
39 friend class List_base;
40 friend class List_Iterator_base;
45 class List_Iterator_base;
49 friend class List_Iterator_base;
52 : f_head (NULL), f_tail (NULL), f_length (0)
55 void insert (Link_base *);
56 void insert_before (List_Iterator_base &, Link_base *);
57 void insert_after (List_Iterator_base &, Link_base *);
58 void append (Link_base *);
59 Link_base *remove (List_Iterator_base &);
61 unsigned int length() const
62 { return (f_length); }
67 unsigned int f_length;
71 class List_Iterator_base
73 friend class List_base;
78 List_Iterator_base (const List_base *list);
79 // Obtain the current link entry.
80 Link_base *item() const
81 { return (f_current); }
82 // Reset the iterator to the first list element.
84 // Reset the iterator to the last list element.
86 // Set the iterator to a new list.
87 void operator= (const List_base *list)
88 { f_list = list; reset(); }
89 // Increment the iterator.
92 operator void*() const
93 { return (f_current); }
96 { return (f_current != (Link_base *)(size_t)i); }
99 // For internal List_base usage.
100 Link_base *previous() const
101 { return (f_previous); }
104 const List_base *f_list;
105 Link_base *f_previous;
106 Link_base *f_current;
109 #endif /* _List_base_hh */
110 /* DO NOT ADD ANY LINES AFTER THIS #endif */