MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / refCount

Class refCount

src/OpenFOAM/memory/refCount/refCount.H:50–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48\*---------------------------------------------------------------------------*/
49
50class refCount
51{
52 // Private data
53
54 int count_;
55
56
57 // Private Member Functions
58
59 //- Dissallow copy
60 refCount(const refCount&);
61
62 //- Dissallow bitwise assignment
63 void operator=(const refCount&);
64
65
66protected:
67
68 // Constructors
69
70 //- Construct null initializing count to 0
71 refCount()
72 :
73 count_(0)
74 {}
75
76
77public:
78
79 // Member Functions
80
81 //- Return the current reference count
82 int count() const
83 {
84 return count_;
85 }
86
87 //- Return true if the reference count is zero
88 bool unique() const
89 {
90 return count_ == 0;
91 }
92
93
94 // Member Operators
95
96 //- Increment the reference count
97 void operator++()
98 {
99 count_++;
100 }
101
102 //- Increment the reference count
103 void operator++(int)
104 {
105 count_++;
106 }
107

Callers 5

fvMatrix.CFile · 0.50
convectionScheme.CFile · 0.50
FieldField.CFile · 0.50
Field.CFile · 0.50
Function1.CFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected