Go to the documentation of this file.
12 #ifndef CPROVER_UTIL_REFERENCE_COUNTING_H
13 #define CPROVER_UTIL_REFERENCE_COUNTING_H
38 #ifdef REFERENCE_COUNTING_DEBUG
39 std::cout <<
"COPY " <<
d <<
" " <<
d->
ref_count <<
'\n';
58 std::swap(other.
d,
d);
101 #ifdef REFERENCE_COUNTING_DEBUG
102 std::cout <<
"COPY " << (&other) <<
"\n";
126 #ifdef REFERENCE_COUNTING_DEBUG
127 std::cout <<
"R: " << old_d <<
" " << old_d->ref_count <<
'\n';
131 if(old_d->ref_count==0)
133 #ifdef REFERENCE_COUNTING_DEBUG
134 std::cout <<
"DELETING " << old_d <<
'\n';
136 std::cout <<
"DEALLOCATING " << old_d <<
"\n";
141 #ifdef REFERENCE_COUNTING_DEBUG
142 std::cout <<
"DONE\n";
150 #ifdef REFERENCE_COUNTING_DEBUG
151 std::cout <<
"DETACH1: " << d <<
'\n';
158 #ifdef REFERENCE_COUNTING_DEBUG
159 std::cout <<
"ALLOCATED " << d <<
'\n';
162 else if(d->ref_count>1)
167 #ifdef REFERENCE_COUNTING_DEBUG
168 std::cout <<
"ALLOCATED " << d <<
'\n';
177 #ifdef REFERENCE_COUNTING_DEBUG
178 std::cout <<
"DETACH2: " << d <<
'\n'
196 {
return !(i1==i2); }
198 #endif // CPROVER_UTIL_REFERENCE_COUNTING_H
#define PRECONDITION(CONDITION)
void remove_ref(dt *old_d)
reference_counting & operator=(const reference_counting &other)
reference_counting(const T &other)
void copy_from(const reference_counting &other)
#define POSTCONDITION(CONDITION)
void swap(reference_counting &other)
reference_counting(const reference_counting &other)
bool operator!=(const reference_counting< T > &i1, const reference_counting< T > &i2)
bool operator==(const reference_counting< T > &o1, const reference_counting< T > &o2)