Changeset 352
- Timestamp:
- Oct 4, 2007, 2:50:09 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Collections/Generic/List.ab
r344 r352 109 109 Return False 110 110 End If 111 112 RemoveAt( index ) 113 Return True 114 End Function 115 116 /*! 117 @brief List内の指定したインデックスの要素を削除する 118 @author Daisuke Yamamoto 119 @date 2007/10/03 120 @return 値が削除されたときはTrue、されなかったときはFlaseが返る 121 */ 122 Sub RemoveAt( index As Long ) 111 123 memmove( items + index*SizeOf(VoidPtr), items + (index+1)*SizeOf(VoidPtr), (size-(index+1))*SizeOf(VoidPtr) ) 112 124 Realloc( size - 1 ) 113 125 size-- 114 Return True 115 End Function 126 End Sub 116 127 End Class 117 128 -
trunk/Include/Classes/System/Delegate.ab
r340 r352 18 18 This.methodPtr = methodPtr 19 19 End Sub 20 21 Function IsEqual( sd As _SimpleDelegate ) As Boolean 22 Return ( This.hasThisPtr = sd.hasThisPtr and ObjPtr(This.object) = ObjPtr(sd.object) and This.methodPtr = sd.methodPtr ) 23 End Function 20 24 End Class 21 25 … … 28 32 For i=0 To ELM(dg.simpleDelegates.Count) 29 33 simpleDelegates.Add( dg.simpleDelegates[i] ) 34 Next 35 End Sub 36 37 Sub _Delete( dg As DelegateBase ) 38 Dim i As Long 39 For i=0 To ELM(This.simpleDelegates.Count) 40 Dim i2 As Long 41 Dim isExist = False 42 For i2=0 To ELM(dg.simpleDelegates.Count) 43 If This.simpleDelegates[i].IsEqual( dg.simpleDelegates[i2] ) Then 44 isExist = True 45 End If 46 Next 47 If isExist Then 48 This.simpleDelegates.RemoveAt( i ) 49 End If 30 50 Next 31 51 End Sub -
trunk/TestCase/SimpleTestCase/DelegateTest.ab
r343 r352 15 15 proc5Flag As Boolean 16 16 proc6Flag As Boolean 17 proc8Flag As Boolean 17 18 18 19 Static staticProc1Flag = False As Boolean … … 30 31 proc5Flag = False 31 32 proc6Flag = False 33 proc8Flag = True 32 34 End Sub 33 35 Function CheckFlags() As Boolean 34 Return proc1Flag and proc2Flag and proc3Flag and proc4Flag and proc5Flag and proc6Flag 36 Return proc1Flag and proc2Flag and proc3Flag and proc4Flag and proc5Flag and proc6Flag and proc8Flag 35 37 End Function 36 38 … … 62 64 Return "Proc7 result[" + str + "]" 63 65 End Function 66 67 Sub Proc8( a As String ) 68 proc8Flag = False 69 End Sub 64 70 End Class 65 71 … … 72 78 dg4 += AddressOf(testObj.Proc5) 73 79 dg4 += AddressOf(testObj.Proc6) 80 dg4 += AddressOf(testObj.Proc8) 81 dg4 -= AddressOf(testObj.Proc8) 74 82 75 83 dg1() -
trunk/TestCase/SimpleTestCase/SimpleTestCase.idx
r340 r352 26 26 #include "DelegateTest.ab" 27 27 _ClearNamespaceImported 28 29 'リソースファイル30 #include "resource.ab"31 #resource "SimpleTestCase.rc" -
trunk/TestCase/SimpleTestCase/SimpleTestCase.pj
r340 r352 7 7 #NAME=SimpleTestCase 8 8 9 #PLATFORM= 329 #PLATFORM=64 10 10 11 11 #USEWINDOW=0 … … 23 23 #DEBUG_EXE_PATH= 24 24 25 #RESOURCE= SimpleTestCase.rc25 #RESOURCE=0 26 26 27 27 #SOURCE -
trunk/bin/SubOperation/templates/delegate_class.tab
r342 r352 7 7 End Sub 8 8 Sub #name#( dg As #name# ) 9 Add( dg )9 _Add( dg ) 10 10 End Sub 11 11 … … 24 24 #call_method_end# 25 25 26 Sub Add( dg As #name# )27 _Add( dg )28 End Sub29 30 26 Function Operator+ ( dg As #name# ) As #name# 31 27 Dim result = New #name#( This ) 32 28 result._Add( dg ) 29 Return result 30 End Function 31 32 Function Operator- ( dg As #name# ) As #name# 33 Dim result = New #name#( This ) 34 result._Delete( dg ) 33 35 Return result 34 36 End Function
Note:
See TracChangeset
for help on using the changeset viewer.