Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / dti_excs / Destructable.hh
1 // $XConsortium: Destructable.hh /main/3 1996/06/11 16:50:40 cde-hal $
2 #ifndef _Exceptions_hh_active
3  #error "Include this file by including Exceptions.hh"
4 #endif
5
6 #ifdef C_API
7 #include "new_delete_simple.h"
8 #endif
9
10 class Destructable
11 {
12 #ifndef NATIVE_EXCEPTIONS
13 public:
14   Destructable();
15   // Copy and assignment constructors necessary to maintain proper
16   // f_in_stack state variable.
17   Destructable (const Destructable &);
18   Destructable &operator = (const Destructable &);
19   virtual ~Destructable();
20
21   int in_stack();
22   int in_stack_set_size();
23
24 #ifdef C_API
25   NEW_AND_DELETE_SIGNATURES(Destructable);
26 #endif
27
28 private:
29 friend class Jump_Environment;
30 friend class Exceptions;
31   static int stack_grows_down()
32     { return (g_size == 0); }
33
34   // Need this special method since Cfront 2.1 doesn't allow direct
35   // call to destructor from another class. 
36   void destruct();
37
38   static void *g_stack_start;
39   // We keep track of the size when the stack grows up.
40   // This is copied over to the unwind stack for stack-based objects. 
41   static unsigned short g_size;
42
43 #endif
44 };