11 #define _CVC3_TRUSTED_
33 RefPtr(T* t):_ptr(t) {
if (_ptr) _ptr->Ref(); }
35 ~RefPtr() {
if (_ptr) _ptr->Unref(); _ptr=0; }
37 if (_ptr==rp.
_ptr)
return *
this;
40 if (_ptr) _ptr->Ref();
41 if (tmp_ptr) tmp_ptr->Unref();
45 if (_ptr==ptr)
return *
this;
48 if (_ptr) _ptr->Ref();
49 if (tmp_ptr) tmp_ptr->Unref();
56 inline T*
get() {
return _ptr; }
57 inline const T*
get()
const {
return _ptr; }
73 void indent( std::ostream& s,
int ind = 0 ){
77 for(
int a=0; a<ind; a++ )
82 Obj(): refCount( 1 ) {}
87 void Ref(){ refCount++; }
97 errs.open(
"errors.txt" );
106 errs.open(
"errors.txt" );
CVC3::ExprStream & endl(CVC3::ExprStream &os)
Print the end-of-line.
void indent(std::ostream &s, int ind=0)
static void print_error(const char *c, std::ostream &s)
const T & operator*() const
int GetRefCount()
get ref count
const T * operator->() const
static void print_warning(const char *c)