File: ACE_Bounded_Stack.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 (153 lines) | stat: -rw-r--r-- 4,282 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
.TH ACE_Bounded_Stack 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Bounded_Stack \- Implement a generic LIFO abstract data type. 
.SH SYNOPSIS
.br
.PP
\fC#include <Containers_T.h>\fR
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "\fBACE_Bounded_Stack\fR (size_t size)"
.br
.RI "\fIInitialize a new stack so that it is empty. The copy constructor (performs initialization).\fR"
.ti -1c
.RI "\fBACE_Bounded_Stack\fR (const ACE_Bounded_Stack<T> &s)"
.br
.ti -1c
.RI "void \fBoperator=\fR (const ACE_Bounded_Stack<T> &s)"
.br
.RI "\fIAssignment operator(performs assignment).\fR"
.ti -1c
.RI "\fB~ACE_Bounded_Stack\fR (void)"
.br
.RI "\fIPerform actions needed when stack goes out of scope.\fR"
.ti -1c
.RI "int \fBpush\fR (const T &new_item)"
.br
.ti -1c
.RI "int \fBpop\fR (T &item)"
.br
.ti -1c
.RI "int \fBtop\fR (T &item) const"
.br
.ti -1c
.RI "int \fBis_empty\fR (void) const"
.br
.RI "\fIReturns 1 if the container is empty, otherwise returns 0.\fR"
.ti -1c
.RI "int \fBis_full\fR (void) const"
.br
.RI "\fIReturns 1 if the container is full, otherwise returns 0.\fR"
.ti -1c
.RI "size_t \fBsize\fR (void) const"
.br
.RI "\fIThe number of items in the stack.\fR"
.ti -1c
.RI "void \fBdump\fR (void) const"
.br
.RI "\fIDump the state of an object.\fR"
.in -1c
.SS Public Attributes

.in +1c
.ti -1c
.RI "\fBACE_ALLOC_HOOK_DECLARE\fR"
.br
.RI "\fIDeclare the dynamic allocation hooks.\fR"
.in -1c
.SS Private Attributes

.in +1c
.ti -1c
.RI "size_t \fBsize_\fR"
.br
.RI "\fISize of the dynamically allocated data.\fR"
.ti -1c
.RI "size_t \fBtop_\fR"
.br
.RI "\fIKeeps track of the current top of stack.\fR"
.ti -1c
.RI "T* \fBstack_\fR"
.br
.RI "\fIHolds the stack's contents.\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP 

.SS template<class T>  template class ACE_Bounded_Stack
Implement a generic LIFO abstract data type.
.PP
.PP
 This implementation of a Stack uses a bounded array that is allocated dynamically. 
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP 
.SS template<classT> ACE_Bounded_Stack<T>::ACE_Bounded_Stack<T> (size_t size)
.PP
Initialize a new stack so that it is empty. The copy constructor (performs initialization).
.PP
.SS template<classT> ACE_Bounded_Stack<T>::ACE_Bounded_Stack<T> (const ACE_Bounded_Stack< T >& s)
.PP
.SS template<classT> ACE_Bounded_Stack<T>::~ACE_Bounded_Stack<T> (void)
.PP
Perform actions needed when stack goes out of scope.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS template<classT> void ACE_Bounded_Stack<T>::dump (void) const
.PP
Dump the state of an object.
.PP
.SS template<classT> int ACE_Bounded_Stack<T>::is_empty (void) const
.PP
Returns 1 if the container is empty, otherwise returns 0.
.PP
.SS template<classT> int ACE_Bounded_Stack<T>::is_full (void) const
.PP
Returns 1 if the container is full, otherwise returns 0.
.PP
.SS template<classT> void ACE_Bounded_Stack<T>::operator= (const ACE_Bounded_Stack< T >& s)
.PP
Assignment operator(performs assignment).
.PP
.SS template<classT> int ACE_Bounded_Stack<T>::pop (T & item)
.PP
Remove and return the top stack item. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs. 
.SS template<classT> int ACE_Bounded_Stack<T>::push (const T & new_item)
.PP
Place a new item on top of the stack. Returns -1 if the stack is already full, 0 if the stack is not already full, and -1 if failure occurs. 
.SS template<classT> size_t ACE_Bounded_Stack<T>::size (void) const
.PP
The number of items in the stack.
.PP
.SS template<classT> int ACE_Bounded_Stack<T>::top (T & item) const
.PP
Return top stack item without removing it. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs. 
.SH MEMBER DATA DOCUMENTATION
.PP 
.SS template<classT> ACE_Bounded_Stack<T>::ACE_ALLOC_HOOK_DECLARE
.PP
Declare the dynamic allocation hooks.
.PP
.SS template<classT> size_t ACE_Bounded_Stack<T>::size_\fC [private]\fR
.PP
Size of the dynamically allocated data.
.PP
.SS template<classT> T * ACE_Bounded_Stack<T>::stack_\fC [private]\fR
.PP
Holds the stack's contents.
.PP
.SS template<classT> size_t ACE_Bounded_Stack<T>::top_\fC [private]\fR
.PP
Keeps track of the current top of stack.
.PP


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