// $Id$ // COPYRIGHT T.R.BARBOUR 1995. All rights reserved. // =============================================== #ifndef Indirect_H #define Indirect_H #include "pointer.h" #include "garbage.h" #include "magequal.h" #include "buglevs.h" #undef DEBUG_LEVEL #define DEBUG_LEVEL DEBUG_Indirect #include "checking.h" template class Indirect: public Pointer, public Garbage { Declerr; private: virtual void destroyReferent(); public: Indirect() {} Indirect(T* p): Pointer(p) {} Indirect(const Indirect& rv): Garbage(rv), Pointer(rv) {} Indirect(const Pointer& p, const Garbage& g): Garbage(g), Pointer(p){} ~Indirect() { collect(); } OPERATOR_EQUALS(Indirect); }; template class Indirect_Cast { public: Indirect_Cast() {} Indirect operator ()(Indirect rv) const { return Indirect(Pointer_Cast()(rv), rv); } }; #include "uncheck.h" #endif