2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $TOG: Destructable_il.hh /main/9 1998/04/20 10:06:23 mgreess $
25 // /////////////////////////////////////////////////////////////////
27 // /////////////////////////////////////////////////////////////////
30 Destructable::Destructable()
32 // Make sure the application has initialized this library.
34 Exceptions::check_initialized();
37 if (in_stack_set_size())
38 Jump_Environment::register_object (this);
39 PRINTF ((" Constructed obj @ %p\n", this));
43 // NOTE: Both the copy and assignment constructors below init
44 // f_constructed to 0, which is going to be bogus if the derived
45 // class checks this value. This is a problem because we don't
46 // know if the derived class uses the default copy constructor or
47 // not. If it does we want f_constructed to be set to 1, otherwise
48 // we want it to be set to 0 until its methods complete.
51 // /////////////////////////////////////////////////////////////////
53 // /////////////////////////////////////////////////////////////////
56 Destructable::Destructable (const Destructable &)
58 if (in_stack_set_size())
59 Jump_Environment::register_object (this);
60 PRINTF ((" Copy ctor @ %p\n", this));
64 // /////////////////////////////////////////////////////////////////
65 // assignment operator
66 // /////////////////////////////////////////////////////////////////
69 Destructable::operator = (const Destructable &)
71 // Assignment operator does nothing to preserve state of original
72 // creation of this object. State information is permanently
73 // associated with a Destructable object and cannot be assigned to.
74 PRINTF (("Assign op @ %p\n", this));
79 // /////////////////////////////////////////////////////////////////
81 // /////////////////////////////////////////////////////////////////
83 // There is currently no checking here for objects that have not
84 // been constructed. It is possible for this to be called for such
85 // objects if an exception is thrown in a constructor. See test18.C.
88 Destructable::~Destructable()
91 Jump_Environment::unregister_object (this);
94 // /////////////////////////////////////////////////////////////////
96 // /////////////////////////////////////////////////////////////////
98 // This code relies on the fact that in cfront 2.1 this qualified
99 // call to the destructor will actually call the virtual destructor.
101 #if !defined(hpux) && (CC_VERSION < 30)
103 Destructable::destruct()
105 #if defined(linux) || defined(CSRG_BASED) || defined(sun)
108 // Have to call this here since some compilers don't allow
109 // qualified calls through object pointer.
110 Destructable::~Destructable();