comparison dstep/foundation/NSGarbageCollector.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 19885b43130e
comparison
equal deleted inserted replaced
13:4f583f7e242e 14:89f3c3ef1fd2
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;
10 import dstep.objc.bridge.Bridge;
11 import dstep.objc.objc : id;
12
13 class NSGarbageCollector : NSObject
14 {
15 mixin ObjcWrap;
16
17 static Object defaultCollector ()
18 {
19 return invokeObjcSelfClass!(Object, "defaultCollector");
20 }
21
22 bool isCollecting ()
23 {
24 return invokeObjcSelf!(bool, "isCollecting");
25 }
26
27 void disable ()
28 {
29 return invokeObjcSelf!(void, "disable");
30 }
31
32 void enable ()
33 {
34 return invokeObjcSelf!(void, "enable");
35 }
36
37 bool isEnabled ()
38 {
39 return invokeObjcSelf!(bool, "isEnabled");
40 }
41
42 void collectIfNeeded ()
43 {
44 return invokeObjcSelf!(void, "collectIfNeeded");
45 }
46
47 void collectExhaustively ()
48 {
49 return invokeObjcSelf!(void, "collectExhaustively");
50 }
51
52 void disableCollectorForPointer (void* ptr)
53 {
54 return invokeObjcSelf!(void, "disableCollectorForPointer:", void*)(ptr);
55 }
56
57 void enableCollectorForPointer (void* ptr)
58 {
59 return invokeObjcSelf!(void, "enableCollectorForPointer:", void*)(ptr);
60 }
61
62 NSZone* zone ()
63 {
64 return invokeObjcSelf!(NSZone*, "zone");
65 }
66 }
67