1 // $TOG: Destructable_il.hh /main/9 1998/04/20 10:06:23 mgreess $
3 // /////////////////////////////////////////////////////////////////
5 // /////////////////////////////////////////////////////////////////
8 Destructable::Destructable()
10 // Make sure the application has initialized this library.
12 Exceptions::check_initialized();
15 if (in_stack_set_size())
16 Jump_Environment::register_object (this);
17 PRINTF ((" Constructed obj @ %p\n", this));
21 // NOTE: Both the copy and assignment constructors below init
22 // f_constructed to 0, which is going to be bogus if the derived
23 // class checks this value. This is a problem because we don't
24 // know if the derived class uses the default copy constructor or
25 // not. If it does we want f_constructed to be set to 1, otherwise
26 // we want it to be set to 0 until its methods complete.
29 // /////////////////////////////////////////////////////////////////
31 // /////////////////////////////////////////////////////////////////
34 Destructable::Destructable (const Destructable &)
36 if (in_stack_set_size())
37 Jump_Environment::register_object (this);
38 PRINTF ((" Copy ctor @ %p\n", this));
42 // /////////////////////////////////////////////////////////////////
43 // assignment operator
44 // /////////////////////////////////////////////////////////////////
47 Destructable::operator = (const Destructable &)
49 // Assignment operator does nothing to preserve state of original
50 // creation of this object. State information is permanently
51 // associated with a Destructable object and cannot be assigned to.
52 PRINTF (("Assign op @ %p\n", this));
57 // /////////////////////////////////////////////////////////////////
59 // /////////////////////////////////////////////////////////////////
61 // There is currently no checking here for objects that have not
62 // been constructed. It is possible for this to be called for such
63 // objects if an exception is thrown in a constructor. See test18.C.
66 Destructable::~Destructable()
69 Jump_Environment::unregister_object (this);
72 // /////////////////////////////////////////////////////////////////
74 // /////////////////////////////////////////////////////////////////
76 // This code relies on the fact that in cfront 2.1 this qualified
77 // call to the destructor will actually call the virtual destructor.
79 #if (!defined(hpux)) && (!defined(__uxp__)) && (CC_VERSION < 30)
81 Destructable::destruct()
83 #if defined(linux) || defined(CSRG_BASED)
86 // Have to call this here since some compilers don't allow
87 // qualified calls through object pointer.
88 Destructable::~Destructable();