File: ACE_Intrusive_List.3

package info (click to toggle)
ace 5.2.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 26,856 kB
  • ctags: 18,677
  • sloc: cpp: 171,831; makefile: 48,840; sh: 10,192; perl: 8,582; exp: 787; yacc: 387; lex: 140; csh: 20
file content (190 lines) | stat: -rw-r--r-- 4,897 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
.TH ACE_Intrusive_List 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Intrusive_List \- Implement an intrusive double linked list. 
.SH SYNOPSIS
.br
.PP
\fC#include <Intrusive_List.h>\fR
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "\fBACE_Intrusive_List\fR (void)"
.br
.RI "\fIConstructor. Use user specified allocation strategy if specified.\fR"
.ti -1c
.RI "\fB~ACE_Intrusive_List\fR (void)"
.br
.RI "\fIDestructor.\fR"
.ti -1c
.RI "int \fBempty\fR (void) const"
.br
.RI "\fIReturns 1 if the container is empty, otherwise returns 0.\fR"
.ti -1c
.RI "void \fBpush_front\fR (T *node)"
.br
.RI "\fIInsert an element at the beginning of the list.\fR"
.ti -1c
.RI "void \fBpush_back\fR (T *node)"
.br
.RI "\fIInsert an element at the end of the list.\fR"
.ti -1c
.RI "T* \fBpop_front\fR (void)"
.br
.RI "\fIRemove the element at the beginning of the list.\fR"
.ti -1c
.RI "T* \fBpop_back\fR (void)"
.br
.RI "\fIRemove the element at the end of the list.\fR"
.ti -1c
.RI "T* \fBhead\fR (void) const"
.br
.RI "\fIGet the element at the head of the queue.\fR"
.ti -1c
.RI "T* \fBtail\fR (void) const"
.br
.RI "\fIGet the element at the tail of the queue.\fR"
.ti -1c
.RI "void \fBremove\fR (T *node)"
.br
.RI "\fIRemove a element from the list.\fR"
.in -1c
.SS Private Methods

.in +1c
.ti -1c
.RI "void \fBremove_i\fR (T *node)"
.br
.RI "\fIRemove a element from the list.\fR"
.in -1c
.PP
.RI "\fBDisallow copying\fR"
.br

.in +1c
.in +1c
.ti -1c
.RI "\fBACE_Intrusive_List\fR (const ACE_Intrusive_List<T> &)"
.br
.ti -1c
.RI "ACE_Intrusive_List<T>& \fBoperator=\fR (const ACE_Intrusive_List<T> &)"
.br
.in -1c
.in -1c
.SS Private Attributes

.in +1c
.ti -1c
.RI "T* \fBhead_\fR"
.br
.RI "\fIHead and tail of the list.\fR"
.ti -1c
.RI "T* \fBtail_\fR"
.br
.in -1c
.SH DETAILED DESCRIPTION
.PP 

.SS template<class T>  template class ACE_Intrusive_List
Implement an intrusive double linked list.
.PP
.PP
 Intrusive lists assume that the elements they contain the pointers required to build the list. They are useful as light-weight containers and free-lists.
.PP
The template argument T must implement the following methods:
.PP
.TP
T* T::next () const;
.TP
void T::next (T *);
.TP
T* T::prev () const;
.TP
void T::prev (T* );A simple way to satisfy the Intrusive_List requirements would be to implement a helper class:
.PP
class My_Object : public \fBACE_Intrusive_List_Node\fR<My_Object> {
.br
 ....
.br
 };
.br

.PP
typedef ACE_Intrusive_List<My_Object> My_Object_List;
.PP
However, \fBACE\fR is supported on platforms that would surely get confused using such templates.
.PP
\fB\fBTodo: \fR\fR
.in +1c
The \fBACE_Message_Queue\fR is an example of an intrusive list (or queue) but it is not implemented in terms of this class. 
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP 
.SS template<classT> ACE_Intrusive_List<T>::ACE_Intrusive_List<T> (void)
.PP
Constructor. Use user specified allocation strategy if specified.
.PP
.SS template<classT> ACE_Intrusive_List<T>::~ACE_Intrusive_List<T> (void)
.PP
Destructor.
.PP
.SS template<classT> ACE_Intrusive_List<T>::ACE_Intrusive_List<T> (const ACE_Intrusive_List< T >&)\fC [private]\fR
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS template<classT> int ACE_Intrusive_List<T>::empty (void) const
.PP
Returns 1 if the container is empty, otherwise returns 0.
.PP
.SS template<classT> T * ACE_Intrusive_List<T>::head (void) const
.PP
Get the element at the head of the queue.
.PP
.SS template<classT> ACE_Intrusive_List< T >& ACE_Intrusive_List<T>::operator=<T> (const ACE_Intrusive_List< T >&)\fC [private]\fR
.PP
.SS template<classT> T * ACE_Intrusive_List<T>::pop_back (void)
.PP
Remove the element at the end of the list.
.PP
.SS template<classT> T * ACE_Intrusive_List<T>::pop_front (void)
.PP
Remove the element at the beginning of the list.
.PP
.SS template<classT> void ACE_Intrusive_List<T>::push_back (T * node)
.PP
Insert an element at the end of the list.
.PP
.SS template<classT> void ACE_Intrusive_List<T>::push_front (T * node)
.PP
Insert an element at the beginning of the list.
.PP
.SS template<classT> void ACE_Intrusive_List<T>::remove (T * node)
.PP
Remove a element from the list.
.PP
Verify that the element is still in the list before removing it. 
.SS template<classT> void ACE_Intrusive_List<T>::remove_i (T * node)\fC [private]\fR
.PP
Remove a element from the list.
.PP
No attempts are performed to check if T* really belongs to the list. The effects of removing an invalid element are unspecified 
.SS template<classT> T * ACE_Intrusive_List<T>::tail (void) const
.PP
Get the element at the tail of the queue.
.PP
.SH MEMBER DATA DOCUMENTATION
.PP 
.SS template<classT> T * ACE_Intrusive_List<T>::head_\fC [private]\fR
.PP
Head and tail of the list.
.PP
.SS template<classT> T * ACE_Intrusive_List<T>::tail_\fC [private]\fR
.PP


.SH AUTHOR
.PP 
Generated automatically by Doxygen for ACE from the source code.