CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
RefCount
src
ZMuseCount.cc
Go to the documentation of this file.
1
// ----------------------------------------------------------------------
2
//
3
// ZMuseCount.cc - utility class for use in reference-counting
4
//
5
//
6
// History:
7
// 19-Sep-1997 WEB Design stolen, and code adapted, from pp 70-73 of
8
// Koenig & Moo: "Ruminations on C++" (1996)
9
//
10
// ----------------------------------------------------------------------
11
12
13
#ifndef ZMUSECOUNT_H
14
#include "CLHEP/RefCount/ZMuseCount.h"
15
#include "CLHEP/RefCount/ZMuseCount.icc"
16
#endif
17
18
19
bool
ZMuseCount::makeonly
() {
20
21
bool
result = ( !
only
() );
22
23
if
( result ) {
24
--*p;
25
p =
new
int(1);
26
}
27
28
return
result;
29
30
}
// makeonly()
31
32
33
bool
ZMuseCount::reattach
(
const
ZMuseCount
& u ) {
34
35
++*u.p;
36
37
bool
result = ( --*p == 0 );
38
if
( result )
39
delete
p;
40
41
p = u.p;
42
return
result;
43
44
}
// reattach()
ZMuseCount::makeonly
bool makeonly()
Definition:
ZMuseCount.cc:19
ZMuseCount::only
bool only()
ZMuseCount::reattach
bool reattach(const ZMuseCount &u)
Definition:
ZMuseCount.cc:33
ZMuseCount
Definition:
Exceptions/CLHEP/RefCount/ZMuseCount.h:17
Generated by
1.8.9.1