File: ACE_Refcounted_Auto_Ptr.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 (170 lines) | stat: -rw-r--r-- 6,511 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
.TH ACE_Refcounted_Auto_Ptr 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Refcounted_Auto_Ptr \- This class implements support for a reference counted \fBauto_ptr\fR. Assigning or copying instances of an ACE_Refcounted_Auto_Ptr will automatically increment the reference count. When the last instance that references a ACE_Refcounted_Auto_Ptr instance is destroyed or overwritten, it will invoke delete on its underlying pointer. 
.SH SYNOPSIS
.br
.PP
\fC#include <Refcounted_Auto_Ptr.h>\fR
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "\fBACE_Refcounted_Auto_Ptr\fR (X *p = 0)"
.br
.RI "\fIConstructor that initializes an  to point to the result <r> immediately.\fR"
.ti -1c
.RI "\fBACE_Refcounted_Auto_Ptr\fR (const ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> &r)"
.br
.RI "\fICopy constructor binds <this> and <r> to the same . An  is created if necessary.\fR"
.ti -1c
.RI "virtual \fB~ACE_Refcounted_Auto_Ptr\fR (void)"
.br
.RI "\fIDestructor.\fR"
.ti -1c
.RI "void \fBoperator=\fR (const ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> &r)"
.br
.RI "\fIAssignment operator that binds <this> and <r> to the same . An  is created if necessary.\fR"
.ti -1c
.RI "int \fBoperator==\fR (const ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> &r) const"
.br
.RI "\fIEquality operator that returns 1 if both ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> objects point to the same \fBACE_Refcounted_Auto_Ptr_Rep\fR<X, ACE_LOCK> object. Attention: It also returns 1 if both objects have just been instantiated and not used yet.\fR"
.ti -1c
.RI "int \fBoperator!=\fR (const ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> &r) const"
.br
.RI "\fIInequality operator, which is the opposite of equality.\fR"
.ti -1c
.RI "X* \fBoperator->\fR (void) const"
.br
.RI "\fIRedirection operator.\fR"
.ti -1c
.RI "X& \fBoperator *\fR () const"
.br
.ti -1c
.RI "X* \fBrelease\fR (void)"
.br
.RI "\fISets the pointer value to 0 and returns its old value.\fR"
.ti -1c
.RI "void \fBreset\fR (X *p = 0)"
.br
.RI "\fIInvokes delete on the previous pointer value and then sets the pointer value to the specified value.\fR"
.ti -1c
.RI "X* \fBget\fR (void)"
.br
.RI "\fIGet the pointer value.\fR"
.ti -1c
.RI "int \fBcount\fR (void) const"
.br
.RI "\fIGet the reference count value.\fR"
.ti -1c
.RI "int \fBnull\fR (void) const"
.br
.RI "\fIAllows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects.\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 Types

.in +1c
.ti -1c
.RI "typedef \fBACE_Refcounted_Auto_Ptr_Rep\fR<X, ACE_LOCK> \fBAUTO_REFCOUNTED_PTR_REP\fR"
.br
.RI "\fIthe \fBACE_Refcounted_Auto_Ptr_Rep\fR.\fR"
.in -1c
.SS Private Attributes

.in +1c
.ti -1c
.RI "\fBAUTO_REFCOUNTED_PTR_REP\fR* \fBrep_\fR"
.br
.RI "\fIProtect operations on the .\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP 

.SS template<class X, class ACE_LOCK>  template class ACE_Refcounted_Auto_Ptr
This class implements support for a reference counted \fBauto_ptr\fR. Assigning or copying instances of an ACE_Refcounted_Auto_Ptr will automatically increment the reference count. When the last instance that references a ACE_Refcounted_Auto_Ptr instance is destroyed or overwritten, it will invoke delete on its underlying pointer.
.PP
.SH MEMBER TYPEDEF DOCUMENTATION
.PP 
.SS template<classX, classACE_LOCK> typedef \fBACE_Refcounted_Auto_Ptr_Rep\fR<X, ACE_LOCK> ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::AUTO_REFCOUNTED_PTR_REP\fC [private]\fR
.PP
the \fBACE_Refcounted_Auto_Ptr_Rep\fR.
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP 
.SS template<classX, classACE_LOCK> ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> (X * p = 0)
.PP
Constructor that initializes an  to point to the result <r> immediately.
.PP
.SS template<classX, classACE_LOCK> ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> (const ACE_Refcounted_Auto_Ptr< X,ACE_LOCK >& r)
.PP
Copy constructor binds <this> and <r> to the same . An  is created if necessary.
.PP
.SS template<classX, classACE_LOCK> ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::~ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> (void)\fC [virtual]\fR
.PP
Destructor.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS template<classX, classACE_LOCK> int ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::count (void) const
.PP
Get the reference count value.
.PP
.SS template<classX, classACE_LOCK> X * ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::get (void)
.PP
Get the pointer value.
.PP
.SS template<classX, classACE_LOCK> int ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::null (void) const
.PP
Allows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects.
.PP
.SS template<classX, classACE_LOCK> X& ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::operator * () const
.PP
.SS template<classX, classACE_LOCK> int ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::operator!= (const ACE_Refcounted_Auto_Ptr< X,ACE_LOCK >& r) const
.PP
Inequality operator, which is the opposite of equality.
.PP
.SS template<classX, classACE_LOCK> X * ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::operator-> (void) const
.PP
Redirection operator.
.PP
.SS template<classX, classACE_LOCK> void ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::operator= (const ACE_Refcounted_Auto_Ptr< X,ACE_LOCK >& r)
.PP
Assignment operator that binds <this> and <r> to the same . An  is created if necessary.
.PP
.SS template<classX, classACE_LOCK> int ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::operator== (const ACE_Refcounted_Auto_Ptr< X,ACE_LOCK >& r) const
.PP
Equality operator that returns 1 if both ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> objects point to the same \fBACE_Refcounted_Auto_Ptr_Rep\fR<X, ACE_LOCK> object. Attention: It also returns 1 if both objects have just been instantiated and not used yet.
.PP
.SS template<classX, classACE_LOCK> X * ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::release (void)
.PP
Sets the pointer value to 0 and returns its old value.
.PP
.SS template<classX, classACE_LOCK> void ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::reset (X * p = 0)
.PP
Invokes delete on the previous pointer value and then sets the pointer value to the specified value.
.PP
.SH MEMBER DATA DOCUMENTATION
.PP 
.SS template<classX, classACE_LOCK> ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::ACE_ALLOC_HOOK_DECLARE
.PP
Declare the dynamic allocation hooks.
.PP
.SS template<classX, classACE_LOCK> \fBAUTO_REFCOUNTED_PTR_REP\fR * ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::rep_\fC [private]\fR
.PP
Protect operations on the .
.PP


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