|
a/src/utils/refcntr.h |
|
b/src/utils/refcntr.h |
|
... |
|
... |
39 |
delete pcount;
|
39 |
delete pcount;
|
40 |
}
|
40 |
}
|
41 |
rep = 0;
|
41 |
rep = 0;
|
42 |
pcount = 0;
|
42 |
pcount = 0;
|
43 |
}
|
43 |
}
|
|
|
44 |
void reset() {
|
|
|
45 |
release();
|
|
|
46 |
}
|
44 |
~RefCntr()
|
47 |
~RefCntr()
|
45 |
{
|
48 |
{
|
46 |
release();
|
49 |
release();
|
47 |
}
|
50 |
}
|
48 |
X *operator->() {return rep;}
|
51 |
X *operator->() {return rep;}
|
49 |
X *getptr() const {return rep;}
|
52 |
X *getptr() const {return rep;}
|
|
|
53 |
X *get() const {return rep;}
|
50 |
const X *getconstptr() const {return rep;}
|
54 |
const X *getconstptr() const {return rep;}
|
51 |
int getcnt() const {return pcount ? *pcount : 0;}
|
55 |
int getcnt() const {return pcount ? *pcount : 0;}
|
52 |
bool isNull() const {return rep == 0;}
|
56 |
bool isNull() const {return rep == 0;}
|
53 |
bool isNotNull() const {return rep != 0;}
|
57 |
bool isNotNull() const {return rep != 0;}
|
|
|
58 |
operator bool() const {return rep != 0;}
|
54 |
};
|
59 |
};
|
55 |
|
60 |
|
56 |
|
61 |
|
57 |
#endif /*_REFCNTR_H_ */
|
62 |
#endif /*_REFCNTR_H_ */
|