Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

root/tags/releases/0.99.8/object.di

Revision 4425, 3.6 kB (checked in by fawzi, 3 years ago)

ptrdiff_t iframe

  • Property svn:eol-style set to native
Line 
1 module object;
2
3 alias typeof(int.sizeof)                    size_t;
4 alias typeof(cast(void*)0 - cast(void*)0)   ptrdiff_t;
5
6 alias size_t hash_t;
7 alias int equals_t;
8
9 class Object
10 {
11     char[] toString();
12     hash_t toHash();
13     int    opCmp(Object o);
14     equals_t    opEquals(Object o);
15
16     interface Monitor
17     {
18         void lock();
19         void unlock();
20     }
21 }
22
23 struct Interface
24 {
25     ClassInfo   classinfo;
26     void*[]     vtbl;
27     ptrdiff_t   offset;   // offset to Interface 'this' from Object 'this'
28 }
29
30 class ClassInfo : Object
31 {
32     byte[]      init;   // class static initializer
33     char[]      name;   // class name
34     void*[]     vtbl;   // virtual function pointer table
35     Interface[] interfaces;
36     ClassInfo   base;
37     void*       destructor;
38     void(*classInvariant)(Object);
39     uint        flags;
40     // 1:       // IUnknown
41     // 2:       // has no possible pointers into GC memory
42     // 4:       // has offTi[] member
43     // 8:       // has constructors
44     void*       deallocator;
45     OffsetTypeInfo[] offTi;
46     void*       defaultConstructor;
47
48     static ClassInfo find(char[] classname);
49     Object create();
50 }
51
52 struct OffsetTypeInfo
53 {
54     size_t   offset;
55     TypeInfo ti;
56 }
57
58 class TypeInfo
59 {
60     hash_t   getHash(void *p);
61     equals_t      equals(void *p1, void *p2);
62     int      compare(void *p1, void *p2);
63     size_t   tsize();
64     void     swap(void *p1, void *p2);
65     TypeInfo next();
66     void[]   init();
67     uint     flags();
68     // 1:    // has possible pointers into GC memory
69     OffsetTypeInfo[] offTi();
70 }
71
72 class TypeInfo_Typedef : TypeInfo
73 {
74     TypeInfo base;
75     char[]   name;
76     void[]   m_init;
77 }
78
79 class TypeInfo_Enum : TypeInfo_Typedef
80 {
81 }
82
83 class TypeInfo_Pointer : TypeInfo
84 {
85     TypeInfo m_next;
86 }
87
88 class TypeInfo_Array : TypeInfo
89 {
90     TypeInfo value;
91 }
92
93 class TypeInfo_StaticArray : TypeInfo
94 {
95     TypeInfo value;
96     size_t   len;
97 }
98
99 class TypeInfo_AssociativeArray : TypeInfo
100 {
101     TypeInfo value;
102     TypeInfo key;
103 }
104
105 class TypeInfo_Function : TypeInfo
106 {
107     TypeInfo next;
108 }
109
110 class TypeInfo_Delegate : TypeInfo
111 {
112     TypeInfo next;
113 }
114
115 class TypeInfo_Class : TypeInfo
116 {
117     ClassInfo info;
118 }
119
120 class TypeInfo_Interface : TypeInfo
121 {
122     ClassInfo info;
123 }
124
125 class TypeInfo_Struct : TypeInfo
126 {
127     char[] name;
128     void[] m_init;
129
130     uint function(void*)      xtoHash;
131     int function(void*,void*) xopEquals;
132     int function(void*,void*) xopCmp;
133     char[] function(void*)    xtoString;
134
135     uint m_flags;
136 }
137
138 class TypeInfo_Tuple : TypeInfo
139 {
140     TypeInfo[]  elements;
141 }
142
143 class ModuleInfo
144 {
145     char[]          name;
146     ModuleInfo[]    importedModules;
147     ClassInfo[]     localClasses;
148     uint            flags;
149
150     void function() ctor;
151     void function() dtor;
152     void function() unitTest;
153
154     version(GNU){}
155     else{
156         void* xgetMembers;
157         void function() ictor;
158     }
159    
160     static int opApply( int delegate( inout ModuleInfo ) );
161 }
162
163 class Exception : Object
164 {
165     struct FrameInfo{
166         long line;
167         ptrdiff_t iframe;
168         ptrdiff_t offset;
169         size_t address;
170         char[] file;
171         char[] func;
172         char[256] charBuf;
173         void writeOut(void delegate(char[])sink);
174     }
175     interface TraceInfo
176     {
177         int opApply( int delegate( ref FrameInfo fInfo) );
178     }
179
180     char[]      msg;
181     char[]      file;
182     size_t      line;  // long would be better
183     TraceInfo   info;
184     Exception   next;
185
186     this(char[] msg, char[] file, long line, Exception next, TraceInfo info );
187     this(char[] msg, Exception next=null);
188     this(char[] msg, char[] file, long line, Exception next = null);
189     char[] toString();
190     void writeOut(void delegate(char[]) sink);
191 }
Note: See TracBrowser for help on using the browser.