| 48 | \*---------------------------------------------------------------------------*/ |
| 49 | |
| 50 | class 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 | |
| 66 | protected: |
| 67 | |
| 68 | // Constructors |
| 69 | |
| 70 | //- Construct null initializing count to 0 |
| 71 | refCount() |
| 72 | : |
| 73 | count_(0) |
| 74 | {} |
| 75 | |
| 76 | |
| 77 | public: |
| 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 |
no outgoing calls
no test coverage detected