comparison dstep/foundation/NSAutoreleasePool.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 89f3c3ef1fd2
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
4 * Version: Initial created: Aug 3, 2009 4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */ 6 */
7 module dstep.foundation.NSAutoreleasePool; 7 module dstep.foundation.NSAutoreleasePool;
8 8
9 import dstep.foundation.NSDebug;
10 import dstep.foundation.NSObjCRuntime;
9 import dstep.foundation.NSObject; 11 import dstep.foundation.NSObject;
10 import dstep.objc.bridge.Bridge; 12 import dstep.objc.bridge.Bridge;
11 import dstep.objc.objc : id; 13 import dstep.objc.objc;
12 14
13 class NSAutoreleasePool : NSObject 15 class NSAutoreleasePool : NSObject
14 { 16 {
15 mixin ObjcWrap; 17 mixin (ObjcWrap);
16 mixin TNSAutoreleasePoolDebugging; 18
19 this ()
20 {
21 super(typeof(this).alloc.init.objcObject);
22 }
23
24 typeof(this) init ()
25 {
26 return invokeObjcSelf!(typeof(this), "init");
27 }
17 28
18 static void addObject (Object anObject) 29 static void addObject (Object anObject)
19 { 30 {
20 return invokeObjcSelfClass!(void, "addObject:", Object)(anObject); 31 return invokeObjcSuperClass!(void, "addObject:", Object)(anObject);
21 } 32 }
22 33
23 void addObject (Object anObject) 34 void addObject (Object anObject)
24 { 35 {
25 return invokeObjcSelf!(void, "addObject:", Object)(anObject); 36 return invokeObjcSelf!(void, "addObject:", Object)(anObject);
27 38
28 void drain () 39 void drain ()
29 { 40 {
30 return invokeObjcSelf!(void, "drain"); 41 return invokeObjcSelf!(void, "drain");
31 } 42 }
43
44 // NSAutoreleasePoolDebugging
45 static void enableRelease (bool enable)
46 {
47 return invokeObjcSuperClass!(void, "enableRelease:", bool)(enable);
48 }
49
50 static void showPools ()
51 {
52 return invokeObjcSuperClass!(void, "showPools");
53 }
54
55 static void resetTotalAutoreleasedObjects ()
56 {
57 return invokeObjcSuperClass!(void, "resetTotalAutoreleasedObjects");
58 }
59
60 static NSUInteger totalAutoreleasedObjects ()
61 {
62 return invokeObjcSuperClass!(NSUInteger, "totalAutoreleasedObjects");
63 }
64
65 static void enableFreedObjectCheck (bool enable)
66 {
67 return invokeObjcSuperClass!(void, "enableFreedObjectCheck:", bool)(enable);
68 }
69
70 static NSUInteger autoreleasedObjectCount ()
71 {
72 return invokeObjcSuperClass!(NSUInteger, "autoreleasedObjectCount");
73 }
74
75 static NSUInteger topAutoreleasePoolCount ()
76 {
77 return invokeObjcSuperClass!(NSUInteger, "topAutoreleasePoolCount");
78 }
79
80 static NSUInteger poolCountHighWaterMark ()
81 {
82 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterMark");
83 }
84
85 static void setPoolCountHighWaterMark (NSUInteger count)
86 {
87 return invokeObjcSuperClass!(void, "setPoolCountHighWaterMark:", NSUInteger)(count);
88 }
89
90 static NSUInteger poolCountHighWaterResolution ()
91 {
92 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterResolution");
93 }
94
95 static void setPoolCountHighWaterResolution (NSUInteger res)
96 {
97 return invokeObjcSuperClass!(void, "setPoolCountHighWaterResolution:", NSUInteger)(res);
98 }
32 } 99 }
33 100