Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / dti_excs / Destructable_il.hh
1 // $TOG: Destructable_il.hh /main/9 1998/04/20 10:06:23 mgreess $
2
3 // /////////////////////////////////////////////////////////////////
4 // class constructor
5 // /////////////////////////////////////////////////////////////////
6
7 inline
8 Destructable::Destructable()
9 {
10   // Make sure the application has initialized this library.
11 #ifdef DEBUG
12   Exceptions::check_initialized();
13 #endif
14
15   if (in_stack_set_size())
16     Jump_Environment::register_object (this);
17   PRINTF (("  Constructed obj @ %p\n", this));
18 }
19
20
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.
27 // Ugh! 
28
29 // /////////////////////////////////////////////////////////////////
30 // copy constructor
31 // /////////////////////////////////////////////////////////////////
32
33 inline
34 Destructable::Destructable (const Destructable &)
35 {
36   if (in_stack_set_size())
37     Jump_Environment::register_object (this);
38   PRINTF (("  Copy ctor @ %p\n", this));
39 }
40
41
42 // /////////////////////////////////////////////////////////////////
43 // assignment operator
44 // /////////////////////////////////////////////////////////////////
45
46 inline Destructable &
47 Destructable::operator = (const Destructable &)
48 {
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));
53   return (*this);
54 }
55
56
57 // /////////////////////////////////////////////////////////////////
58 // class destructor
59 // /////////////////////////////////////////////////////////////////
60
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. 
64
65 inline
66 Destructable::~Destructable()
67 {
68   if (in_stack())
69     Jump_Environment::unregister_object (this);
70 }
71
72 // /////////////////////////////////////////////////////////////////
73 // destruct function
74 // /////////////////////////////////////////////////////////////////
75
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. 
78
79 #if (!defined(hpux)) && (!defined(__uxp__)) && (CC_VERSION < 30)
80 inline void
81 Destructable::destruct()
82 {
83 #if defined(linux) || defined(CSRG_BASED) || defined(sun)
84   delete this;
85 #else
86   // Have to call this here since some compilers don't allow
87   // qualified calls through object pointer.
88   Destructable::~Destructable();
89 #endif
90 }
91 #endif