File: AtomicCounter.3cc

package info (click to toggle)
libcommoncpp2 1.0.13-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,740 kB
  • ctags: 2,860
  • sloc: cpp: 18,857; sh: 8,451; ansic: 1,546; makefile: 299; xml: 5
file content (100 lines) | stat: -rw-r--r-- 2,260 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
.PP
.TH "AtomicCounter" 3 "19 Jul 2003" "CommonC++" \" -*- nroff -*-
.ad l
.nh
.SH NAME
AtomicCounter \- The AtomicCounter class offers thread-safe manipulation of an integer counter. atomic counter operation. 
.SH SYNOPSIS
.br
.PP
\fC#include <thread.h>\fP
.PP
.SS "Public Methods"

.in +1c
.ti -1c
.RI "\fBAtomicCounter\fP ()"
.br
.RI "\fIInitialize an atomic counter to 0.\fP"
.ti -1c
.RI "\fBAtomicCounter\fP (int value)"
.br
.RI "\fIInitialize an atomic counter to a known value.\fP"
.ti -1c
.RI "int \fBoperator++\fP (void)"
.br
.ti -1c
.RI "int \fBoperator--\fP (void)"
.br
.ti -1c
.RI "int \fBoperator+=\fP (int change)"
.br
.ti -1c
.RI "int \fBoperator-=\fP (int change)"
.br
.ti -1c
.RI "int \fBoperator+\fP (int change)"
.br
.ti -1c
.RI "int \fBoperator-\fP (int change)"
.br
.ti -1c
.RI "int \fBoperator=\fP (int value)"
.br
.ti -1c
.RI "bool \fBoperator!\fP (void)"
.br
.ti -1c
.RI "\fBoperator int\fP ()"
.br
.in -1c
.SH "DETAILED DESCRIPTION"
.PP 
The AtomicCounter class offers thread-safe manipulation of an integer counter. atomic counter operation.
.PP
These are commonly used for building thread-safe 'reference' counters for C++ classes. The AtomicCounter depends on the platforms support for 'atomic' integer operations, and can alternately substitute a 'mutex' if no atomic support exists.
.PP
\fBAuthor: \fP
.in +1c
Sean Cavanaugh <sean@dimensionalrift.com> 
.PP
.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION"
.PP 
.SS "AtomicCounter::AtomicCounter ()"
.PP
Initialize an atomic counter to 0.
.PP
.SS "AtomicCounter::AtomicCounter (int value)"
.PP
Initialize an atomic counter to a known value.
.PP
\fBParameters: \fP
.in +1c
.TP
\fB\fIvalue\fP\fP
initial value. 
.SH "MEMBER FUNCTION DOCUMENTATION"
.PP 
.SS "AtomicCounter::operator int ()"
.PP
.SS "bool AtomicCounter::operator! (void)"
.PP
.SS "int AtomicCounter::operator+ (int change)"
.PP
.SS "int AtomicCounter::operator++ (void)"
.PP
.SS "int AtomicCounter::operator+= (int change)"
.PP
.SS "int AtomicCounter::operator- (int change)"
.PP
.SS "int AtomicCounter::operator-- (void)"
.PP
.SS "int AtomicCounter::operator-= (int change)"
.PP
.SS "int AtomicCounter::operator= (int value)"
.PP


.SH "AUTHOR"
.PP 
Generated automatically by Doxygen for CommonC++ from the source code.