Mercurial > projects > dstep
annotate dstep/foundation/NSGarbageCollector.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSGarbageCollector; | |
8 | |
9 import dstep.foundation.NSObject; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
10 import dstep.foundation.NSZone; |
14 | 11 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
12 import dstep.objc.objc; |
14 | 13 |
14 class NSGarbageCollector : NSObject | |
15 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
16 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
17 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
18 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
19 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
20 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
21 } |
14 | 22 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
23 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
24 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 super(NSGarbageCollector.alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
26 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 NSGarbageCollector init () |
14 | 29 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
30 return invokeObjcSelf!(NSGarbageCollector, "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
31 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
32 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
33 static NSGarbageCollector defaultCollector () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
35 return invokeObjcSuperClass!(NSGarbageCollector, "defaultCollector"); |
14 | 36 } |
37 | |
38 bool isCollecting () | |
39 { | |
40 return invokeObjcSelf!(bool, "isCollecting"); | |
41 } | |
42 | |
43 void disable () | |
44 { | |
45 return invokeObjcSelf!(void, "disable"); | |
46 } | |
47 | |
48 void enable () | |
49 { | |
50 return invokeObjcSelf!(void, "enable"); | |
51 } | |
52 | |
53 bool isEnabled () | |
54 { | |
55 return invokeObjcSelf!(bool, "isEnabled"); | |
56 } | |
57 | |
58 void collectIfNeeded () | |
59 { | |
60 return invokeObjcSelf!(void, "collectIfNeeded"); | |
61 } | |
62 | |
63 void collectExhaustively () | |
64 { | |
65 return invokeObjcSelf!(void, "collectExhaustively"); | |
66 } | |
67 | |
68 void disableCollectorForPointer (void* ptr) | |
69 { | |
70 return invokeObjcSelf!(void, "disableCollectorForPointer:", void*)(ptr); | |
71 } | |
72 | |
73 void enableCollectorForPointer (void* ptr) | |
74 { | |
75 return invokeObjcSelf!(void, "enableCollectorForPointer:", void*)(ptr); | |
76 } | |
77 | |
78 NSZone* zone () | |
79 { | |
80 return invokeObjcSelf!(NSZone*, "zone"); | |
81 } | |
82 } | |
83 |