PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/runtime/typeinfo/ti_typedef.d

http://github.com/wilkie/djehuty
D | 63 lines | 42 code | 15 blank | 6 comment | 3 complexity | 05b5d9713b62bddb2c41eab00b12c667 MD5 | raw file
 1/*
 2 * ti_typedef.d
 3 *
 4 * This module implements the TypeInfo for a typedef.
 5 *
 6 */
 7
 8module runtime.typeinfo.ti_typedef;
 9
10class TypeInfo_Typedef : TypeInfo {
11	char[] toString() { return name; }
12
13	int opEquals(Object o) {
14		TypeInfo_Typedef c;
15
16		return cast(int)
17			(this is o ||
18			 ((c = cast(TypeInfo_Typedef)o) !is null &&
19			  this.name == c.name &&
20			  this.base == c.base));
21	}
22
23	hash_t getHash(void *p) {
24		return base.getHash(p);
25	}
26	
27	int equals(void *p1, void *p2) {
28		return base.equals(p1, p2);
29	}
30
31	int compare(void *p1, void *p2) {
32		return base.compare(p1, p2);
33	}
34
35	size_t tsize() {
36		return base.tsize();
37	}
38
39	void swap(void *p1, void *p2) {
40		return base.swap(p1, p2);
41	}
42
43	TypeInfo next() {
44		return base.next();
45	}
46
47	uint flags() {
48		return base.flags();
49	}
50	
51	void[] init() {
52		if (m_init.length > 0) {
53			return m_init;
54		}
55		return base.init();
56	}
57
58	TypeInfo base;
59	char[] name;
60	void[] m_init;
61}
62
63