ObjFW  Check-in [eb791d09d1]

Overview
Comment:Add OFCountedSet.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: eb791d09d19c7d24fd103c75b924ac93487fb3092b8f6fbaae626d488c05f459
User & Date: js on 2011-07-26 21:42:34
Other Links: manifest | tags
Context
2011-07-28
20:50
Don't create and release a pool in -[enumerateObjectsUsingBlock:]. check-in: bfb7745f95 user: js tags: trunk
2011-07-26
21:42
Add OFCountedSet. check-in: eb791d09d1 user: js tags: trunk
18:12
Prepare OFSet and OFMutableSet for OFCountedSet. check-in: 5207c4ea4d user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [5ca12bbfed] to [172b280eb0].

188
189
190
191
192
193
194


195
196
197
198
199
200
201
		4B3D23E71337FCB000DD29B8 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3D236D1337FB5800DD29B8 /* base64.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23E81337FCB000DD29B8 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBA36C511406AB700CBA3AC /* macros.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998C1099E7C50041064A /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; };
		4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3D5693139A617D0010A78F /* OFSerializationTests.m */; };


		4B511B7C139C0A34003764A5 /* OFNull.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B511B7A139C0A34003764A5 /* OFNull.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B511B7D139C0A34003764A5 /* OFNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B511B7B139C0A34003764A5 /* OFNull.m */; };
		4B55A0FF133ABEA900B58A93 /* OFThreadJoinFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */; };
		4B55A101133ABEA900B58A93 /* OFThreadStartFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FB133ABEA900B58A93 /* OFThreadStartFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FC133ABEA900B58A93 /* OFThreadStartFailedException.m */; };
		4B55A103133ABEA900B58A93 /* OFThreadStillRunningException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FD133ABEA900B58A93 /* OFThreadStillRunningException.h */; settings = {ATTRIBUTES = (Public, ); }; };







>
>







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
		4B3D23E71337FCB000DD29B8 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3D236D1337FB5800DD29B8 /* base64.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23E81337FCB000DD29B8 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBA36C511406AB700CBA3AC /* macros.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EB1337FCB000DD29B8 /* unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998C1099E7C50041064A /* unicode.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; };
		4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3D5693139A617D0010A78F /* OFSerializationTests.m */; };
		4B45355313DCFE1E0037AB4D /* OFCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B45355113DCFE1E0037AB4D /* OFCountedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45355213DCFE1E0037AB4D /* OFCountedSet.m */; };
		4B511B7C139C0A34003764A5 /* OFNull.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B511B7A139C0A34003764A5 /* OFNull.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B511B7D139C0A34003764A5 /* OFNull.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B511B7B139C0A34003764A5 /* OFNull.m */; };
		4B55A0FF133ABEA900B58A93 /* OFThreadJoinFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A100133ABEA900B58A93 /* OFThreadJoinFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */; };
		4B55A101133ABEA900B58A93 /* OFThreadStartFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FB133ABEA900B58A93 /* OFThreadStartFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A102133ABEA900B58A93 /* OFThreadStartFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A0FC133ABEA900B58A93 /* OFThreadStartFailedException.m */; };
		4B55A103133ABEA900B58A93 /* OFThreadStillRunningException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A0FD133ABEA900B58A93 /* OFThreadStillRunningException.h */; settings = {ATTRIBUTES = (Public, ); }; };
423
424
425
426
427
428
429


430
431
432
433
434
435
436
		4B3D236D1337FB5800DD29B8 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/base64.h; sourceTree = "<group>"; };
		4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = "<group>"; };
		4B3D23701337FB7500DD29B8 /* OFHTTPRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequestTests.m; path = tests/OFHTTPRequestTests.m; sourceTree = "<group>"; };
		4B3D23761337FBC800DD29B8 /* ObjFW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjFW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
		4B3D23BB1337FC5800DD29B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
		4B3D23EF1338008000DD29B8 /* mach_alias_list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mach_alias_list; path = src/mach_alias_list; sourceTree = SOURCE_ROOT; };
		4B3D5693139A617D0010A78F /* OFSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSerializationTests.m; path = tests/OFSerializationTests.m; sourceTree = "<group>"; };


		4B4986DF1101F64500A2CFDA /* objc_properties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_properties.m; path = src/objc_properties.m; sourceTree = "<group>"; };
		4B4A61F212DF5EA20048F3F2 /* OFURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFURL.h; path = src/OFURL.h; sourceTree = SOURCE_ROOT; };
		4B4A61F312DF5EA20048F3F2 /* OFURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFURL.m; path = src/OFURL.m; sourceTree = SOURCE_ROOT; };
		4B511B7A139C0A34003764A5 /* OFNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNull.h; path = src/OFNull.h; sourceTree = "<group>"; };
		4B511B7B139C0A34003764A5 /* OFNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNull.m; path = src/OFNull.m; sourceTree = "<group>"; };
		4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFThreadJoinFailedException.h; path = src/exceptions/OFThreadJoinFailedException.h; sourceTree = "<group>"; };
		4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFThreadJoinFailedException.m; path = src/exceptions/OFThreadJoinFailedException.m; sourceTree = "<group>"; };







>
>







425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
		4B3D236D1337FB5800DD29B8 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = base64.h; path = src/base64.h; sourceTree = "<group>"; };
		4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = "<group>"; };
		4B3D23701337FB7500DD29B8 /* OFHTTPRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFHTTPRequestTests.m; path = tests/OFHTTPRequestTests.m; sourceTree = "<group>"; };
		4B3D23761337FBC800DD29B8 /* ObjFW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjFW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
		4B3D23BB1337FC5800DD29B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
		4B3D23EF1338008000DD29B8 /* mach_alias_list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mach_alias_list; path = src/mach_alias_list; sourceTree = SOURCE_ROOT; };
		4B3D5693139A617D0010A78F /* OFSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSerializationTests.m; path = tests/OFSerializationTests.m; sourceTree = "<group>"; };
		4B45355113DCFE1E0037AB4D /* OFCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCountedSet.h; path = src/OFCountedSet.h; sourceTree = "<group>"; };
		4B45355213DCFE1E0037AB4D /* OFCountedSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCountedSet.m; path = src/OFCountedSet.m; sourceTree = "<group>"; };
		4B4986DF1101F64500A2CFDA /* objc_properties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = objc_properties.m; path = src/objc_properties.m; sourceTree = "<group>"; };
		4B4A61F212DF5EA20048F3F2 /* OFURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFURL.h; path = src/OFURL.h; sourceTree = SOURCE_ROOT; };
		4B4A61F312DF5EA20048F3F2 /* OFURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFURL.m; path = src/OFURL.m; sourceTree = SOURCE_ROOT; };
		4B511B7A139C0A34003764A5 /* OFNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFNull.h; path = src/OFNull.h; sourceTree = "<group>"; };
		4B511B7B139C0A34003764A5 /* OFNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFNull.m; path = src/OFNull.m; sourceTree = "<group>"; };
		4B55A0F9133ABEA900B58A93 /* OFThreadJoinFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFThreadJoinFailedException.h; path = src/exceptions/OFThreadJoinFailedException.h; sourceTree = "<group>"; };
		4B55A0FA133ABEA900B58A93 /* OFThreadJoinFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFThreadJoinFailedException.m; path = src/exceptions/OFThreadJoinFailedException.m; sourceTree = "<group>"; };
803
804
805
806
807
808
809


810
811
812
813
814
815
816
				4B67995C1099E7C50041064A /* OFAutoreleasePool.h */,
				4B67995D1099E7C50041064A /* OFAutoreleasePool.m */,
				4BD86D801237A6C600ED9912 /* OFBlock.h */,
				4BD86D811237A6C600ED9912 /* OFBlock.m */,
				4BAF5F46123460C900F4E111 /* OFCollection.h */,
				4BE5F0D712DF4225005C7A0C /* OFConstantString.h */,
				4BE5F0D812DF4225005C7A0C /* OFConstantString.m */,


				4B6799601099E7C50041064A /* OFDataArray.h */,
				4B6799611099E7C50041064A /* OFDataArray.m */,
				4BE17AD912FD746D002CEB0B /* OFDataArray+Hashing.h */,
				4BE17ADA12FD746D002CEB0B /* OFDataArray+Hashing.m */,
				4BE5F0D912DF4225005C7A0C /* OFDate.h */,
				4BE5F0DA12DF4225005C7A0C /* OFDate.m */,
				4B6799621099E7C50041064A /* OFDictionary.h */,







>
>







807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
				4B67995C1099E7C50041064A /* OFAutoreleasePool.h */,
				4B67995D1099E7C50041064A /* OFAutoreleasePool.m */,
				4BD86D801237A6C600ED9912 /* OFBlock.h */,
				4BD86D811237A6C600ED9912 /* OFBlock.m */,
				4BAF5F46123460C900F4E111 /* OFCollection.h */,
				4BE5F0D712DF4225005C7A0C /* OFConstantString.h */,
				4BE5F0D812DF4225005C7A0C /* OFConstantString.m */,
				4B45355113DCFE1E0037AB4D /* OFCountedSet.h */,
				4B45355213DCFE1E0037AB4D /* OFCountedSet.m */,
				4B6799601099E7C50041064A /* OFDataArray.h */,
				4B6799611099E7C50041064A /* OFDataArray.m */,
				4BE17AD912FD746D002CEB0B /* OFDataArray+Hashing.h */,
				4BE17ADA12FD746D002CEB0B /* OFDataArray+Hashing.m */,
				4BE5F0D912DF4225005C7A0C /* OFDate.h */,
				4BE5F0DA12DF4225005C7A0C /* OFDate.m */,
				4B6799621099E7C50041064A /* OFDictionary.h */,
1004
1005
1006
1007
1008
1009
1010

1011
1012
1013
1014
1015
1016
1017
			files = (
				4B3D23BC1337FC8300DD29B8 /* OFApplication.h in Headers */,
				4B3D23BD1337FC8300DD29B8 /* OFArray.h in Headers */,
				4B3D23BE1337FC8300DD29B8 /* OFAutoreleasePool.h in Headers */,
				4B3D23BF1337FC8300DD29B8 /* OFBlock.h in Headers */,
				4B3D23C01337FC8300DD29B8 /* OFCollection.h in Headers */,
				4B3D23C11337FC8300DD29B8 /* OFConstantString.h in Headers */,

				4B3D23C21337FC8300DD29B8 /* OFDataArray.h in Headers */,
				4B3D23C31337FC8300DD29B8 /* OFDataArray+Hashing.h in Headers */,
				4B3D23C41337FC8300DD29B8 /* OFDate.h in Headers */,
				4B3D23C51337FCB000DD29B8 /* OFDictionary.h in Headers */,
				4BE852D213B7671200C00856 /* OFDoubleMatrix.h in Headers */,
				4BE852D413B7671200C00856 /* OFDoubleVector.h in Headers */,
				4B3D23C61337FCB000DD29B8 /* OFEnumerator.h in Headers */,







>







1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
			files = (
				4B3D23BC1337FC8300DD29B8 /* OFApplication.h in Headers */,
				4B3D23BD1337FC8300DD29B8 /* OFArray.h in Headers */,
				4B3D23BE1337FC8300DD29B8 /* OFAutoreleasePool.h in Headers */,
				4B3D23BF1337FC8300DD29B8 /* OFBlock.h in Headers */,
				4B3D23C01337FC8300DD29B8 /* OFCollection.h in Headers */,
				4B3D23C11337FC8300DD29B8 /* OFConstantString.h in Headers */,
				4B45355313DCFE1E0037AB4D /* OFCountedSet.h in Headers */,
				4B3D23C21337FC8300DD29B8 /* OFDataArray.h in Headers */,
				4B3D23C31337FC8300DD29B8 /* OFDataArray+Hashing.h in Headers */,
				4B3D23C41337FC8300DD29B8 /* OFDate.h in Headers */,
				4B3D23C51337FCB000DD29B8 /* OFDictionary.h in Headers */,
				4BE852D213B7671200C00856 /* OFDoubleMatrix.h in Headers */,
				4BE852D413B7671200C00856 /* OFDoubleVector.h in Headers */,
				4B3D23C61337FCB000DD29B8 /* OFEnumerator.h in Headers */,
1263
1264
1265
1266
1267
1268
1269

1270
1271
1272
1273
1274
1275
1276
			buildActionMask = 2147483647;
			files = (
				4B3D238B1337FC0D00DD29B8 /* OFApplication.m in Sources */,
				4B3D238C1337FC0D00DD29B8 /* OFArray.m in Sources */,
				4B3D238D1337FC0D00DD29B8 /* OFAutoreleasePool.m in Sources */,
				4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */,
				4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */,

				4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */,
				4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */,
				4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */,
				4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */,
				4BE852D313B7671200C00856 /* OFDoubleMatrix.m in Sources */,
				4BE852D513B7671200C00856 /* OFDoubleVector.m in Sources */,
				4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */,







>







1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
			buildActionMask = 2147483647;
			files = (
				4B3D238B1337FC0D00DD29B8 /* OFApplication.m in Sources */,
				4B3D238C1337FC0D00DD29B8 /* OFArray.m in Sources */,
				4B3D238D1337FC0D00DD29B8 /* OFAutoreleasePool.m in Sources */,
				4B3D238E1337FC0D00DD29B8 /* OFBlock.m in Sources */,
				4B3D238F1337FC0D00DD29B8 /* OFConstantString.m in Sources */,
				4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */,
				4B3D23901337FC0D00DD29B8 /* OFDataArray.m in Sources */,
				4B3D23911337FC0D00DD29B8 /* OFDataArray+Hashing.m in Sources */,
				4B3D23921337FC0D00DD29B8 /* OFDate.m in Sources */,
				4B3D23931337FC0D00DD29B8 /* OFDictionary.m in Sources */,
				4BE852D313B7671200C00856 /* OFDoubleMatrix.m in Sources */,
				4BE852D513B7671200C00856 /* OFDoubleVector.m in Sources */,
				4B3D23941337FC0D00DD29B8 /* OFEnumerator.m in Sources */,

Modified src/Makefile from [478a11b59f] to [8482526187].

8
9
10
11
12
13
14

15
16
17
18
19
20
21
STATIC_LIB = ${OBJFW_STATIC_LIB}

SRCS = OFApplication.m			\
       OFArray.m			\
       OFAutoreleasePool.m		\
       OFBlock.m			\
       OFConstantString.m		\

       OFDataArray.m			\
       OFDataArray+Hashing.m		\
       OFDate.m				\
       OFDictionary.m			\
       OFDoubleMatrix.m			\
       OFDoubleVector.m			\
       OFEnumerator.m			\







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
STATIC_LIB = ${OBJFW_STATIC_LIB}

SRCS = OFApplication.m			\
       OFArray.m			\
       OFAutoreleasePool.m		\
       OFBlock.m			\
       OFConstantString.m		\
       OFCountedSet.m			\
       OFDataArray.m			\
       OFDataArray+Hashing.m		\
       OFDate.m				\
       OFDictionary.m			\
       OFDoubleMatrix.m			\
       OFDoubleVector.m			\
       OFEnumerator.m			\

Added src/OFCountedSet.h version [953f39ec52].

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright (c) 2008, 2009, 2010, 2011
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFSet.h"

#ifdef OF_HAVE_BLOCKS
typedef void (^of_counted_set_enumeration_block_t)(id object, size_t count,
    BOOL *stop);
#endif

/**
 * \brief An unordered set of objects, counting how often it contains an object.
 */
@interface OFCountedSet: OFMutableSet
/**
 * \brief Returns how often the object is in the set.
 *
 * \return How often the object is in the set
 */
- (size_t)countForObject: (id)object;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Executes a block for each object in the set.
 *
 * \param block The block to execute for each object in the set
 */
- (void)enumerateObjectsAndCountUsingBlock:
    (of_counted_set_enumeration_block_t)block;
#endif
@end

Added src/OFCountedSet.m version [c9d1c58489].























































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
/*
 * Copyright (c) 2008, 2009, 2010, 2011
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#define OF_COUNTED_SET_M

#import "OFCountedSet.h"
#import "OFDictionary.h"
#import "OFNumber.h"
#import "OFArray.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"

@implementation OFCountedSet
- initWithSet: (OFSet*)set
{
	self = [super init];

	@try {
		[dictionary release];
		dictionary = nil;
		dictionary = [[OFMutableDictionary alloc]
			_initWithDictionary: set->dictionary
				   copyKeys: NO];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- initWithArray: (OFArray*)array
{
	self = [super init];

	@try {
		id *cArray = [array cArray];
		size_t i, count = [array count];

		for (i = 0; i < count; i++)
			[self addObject: cArray[i]];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- initWithObject: (id)firstObject
       arguments: (va_list)arguments
{
	self = [super init];

	@try {
		id object;

		[self addObject: firstObject];

		while ((object = va_arg(arguments, id)) != nil)
			[self addObject: object];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (OFString*)description
{
	OFMutableString *ret;
	OFAutoreleasePool *pool, *pool2;
	OFEnumerator *keyEnumerator, *objectEnumerator;
	size_t i, count = [dictionary count];
	id key, object;

	if (count == 0)
		return @"{()}";

	ret = [OFMutableString stringWithString: @"{(\n"];
	pool = [[OFAutoreleasePool alloc] init];
	keyEnumerator = [dictionary keyEnumerator];
	objectEnumerator = [dictionary objectEnumerator];

	i = 0;
	pool2 = [[OFAutoreleasePool alloc] init];

	while ((key = [keyEnumerator nextObject]) != nil &&
	    (object = [objectEnumerator nextObject]) != nil) {
		[ret appendString: [key description]];
		[ret appendString: @": "];
		[ret appendString: [object description]];

		if (++i < count)
			[ret appendString: @",\n"];

		[pool2 releaseObjects];
	}
	[ret replaceOccurrencesOfString: @"\n"
			     withString: @"\n\t"];
	[ret appendString: @"\n)}"];

	[pool release];

        /*
	 * Class swizzle the string to be immutable. We declared the return type
	 * to be OFString*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFString class];
	return ret;
}

- copy
{
	return [[OFCountedSet alloc] initWithSet: self];
}

- mutableCopy
{
	return [[OFCountedSet alloc] initWithSet: self];
}

- (size_t)countForObject: (id)object
{
	return [[dictionary objectForKey: object] sizeValue];
}

#ifdef OF_HAVE_BLOCKS
- (void)enumerateObjectsAndCountUsingBlock:
    (of_counted_set_enumeration_block_t)block
{
	[dictionary enumerateKeysAndObjectsUsingBlock: ^ (id key, id object,
	    BOOL *stop) {
		block(key, [object sizeValue], stop);
	}];
}
#endif

- (void)addObject: (id)object
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFNumber *count;

	count = [[dictionary objectForKey: object] numberByIncreasing];

	if (count == nil)
		count = [OFNumber numberWithSize: 1];

	[dictionary _setObject: count
			forKey: object
		       copyKey: NO];

	mutations++;

	[pool release];
}

- (void)removeObject: (id)object
{
	OFNumber *count = [dictionary objectForKey: object];
	OFAutoreleasePool *pool;

	if (count == nil)
		return;

	pool = [[OFAutoreleasePool alloc] init];
	count = [count numberByDecreasing];

	if ([count sizeValue] > 0)
		[dictionary _setObject: count
				forKey: object
			       copyKey: NO];
	else
		[dictionary removeObjectForKey: object];

	mutations++;

	[pool release];
}

- (void)minusSet: (OFSet*)set
{
	OFCountedSet *countedSet;
	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id object;

	if (![set isKindOfClass: [OFCountedSet class]]) {
		[super minusSet: set];
		return;
	}

	countedSet = (OFCountedSet*)set;

	pool = [[OFAutoreleasePool alloc] init];
	enumerator = [countedSet objectEnumerator];

	while ((object = [enumerator nextObject]) != nil) {
		size_t i, count = [countedSet countForObject: object];

		for (i = 0; i < count; i++)
			[self removeObject: object];
	}

	[pool release];
}

- (void)unionSet: (OFSet*)set
{
	OFCountedSet *countedSet;
	OFAutoreleasePool *pool;
	OFEnumerator *enumerator;
	id object;

	if (![set isKindOfClass: [OFCountedSet class]]) {
		[super unionSet: set];
		return;
	}

	countedSet = (OFCountedSet*)set;

	pool = [[OFAutoreleasePool alloc] init];
	enumerator = [countedSet objectEnumerator];

	while ((object = [enumerator nextObject]) != nil) {
		size_t i, count = [countedSet countForObject: object];

		for (i = 0; i < count; i++)
			[self addObject: object];
	}

	[pool release];
}
@end

Modified src/OFDictionary.h from [fe68e3c105] to [49e5b8dc83].

220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
 *		dictionary
 * \return A new, autoreleased OFDictionary
 */
- (OFDictionary*)filteredDictionaryUsingBlock:
    (of_dictionary_filter_block_t)block;
#endif

#ifdef OF_SET_M
- _initWithDictionary: (OFDictionary*)dictionary
	     copyKeys: (BOOL)copyKeys;
#endif
@end

@interface OFDictionaryEnumerator: OFEnumerator
{







|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
 *		dictionary
 * \return A new, autoreleased OFDictionary
 */
- (OFDictionary*)filteredDictionaryUsingBlock:
    (of_dictionary_filter_block_t)block;
#endif

#if defined(OF_SET_M) || defined(OF_COUNTED_SET_M)
- _initWithDictionary: (OFDictionary*)dictionary
	     copyKeys: (BOOL)copyKeys;
#endif
@end

@interface OFDictionaryEnumerator: OFEnumerator
{

Modified src/OFMutableDictionary.h from [7317469848] to [ca4efa5ceb].

51
52
53
54
55
56
57
58
59
60
61
62
63
 * \brief Replaces each object with the object returned by the block.
 *
 * \param block The block which returns a new object for each object
 */
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block;
#endif

#if defined(OF_SET_M) || defined(OF_MUTABLE_SET_M)
- (void)_setObject: (id)object
	    forKey: (id)key
	   copyKey: (BOOL)copyKey;
#endif
@end







|





51
52
53
54
55
56
57
58
59
60
61
62
63
 * \brief Replaces each object with the object returned by the block.
 *
 * \param block The block which returns a new object for each object
 */
- (void)replaceObjectsUsingBlock: (of_dictionary_replace_block_t)block;
#endif

#if defined(OF_SET_M) || defined(OF_MUTABLE_SET_M) || defined(OF_COUNTED_SET_M)
- (void)_setObject: (id)object
	    forKey: (id)key
	   copyKey: (BOOL)copyKey;
#endif
@end

Modified src/OFMutableSet.m from [ff741b1139] to [917221d23f].

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
	OFArray *objects = [dictionary allKeys];
	id *cArray = [objects cArray];
	size_t count = [objects count];
	size_t i;

	for (i = 0; i < count; i++)
		if (![set containsObject: cArray[i]])
			[self removeObject: cArray[i]];

	[pool release];
}

- (void)unionSet: (OFSet*)set
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
	OFArray *objects = [dictionary allKeys];
	id *cArray = [objects cArray];
	size_t count = [objects count];
	size_t i;

	for (i = 0; i < count; i++)
		if (![set containsObject: cArray[i]])
			[dictionary removeObjectForKey: cArray[i]];

	[pool release];
}

- (void)unionSet: (OFSet*)set
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

Modified src/OFSet.h from [ccc5bd9784] to [d4e9745629].

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
 * \return Whether the receiver and the specified set have at least one object
 *	   in common
 */
- (BOOL)intersectsSet: (OFSet*)set;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Executes a block for each object.
 *
 * \param block The block to execute for each object
 */
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;

/**
 * \brief Returns a new set, only containing the objects for which the block
 *	  returns YES.
 *







|

|







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
 * \return Whether the receiver and the specified set have at least one object
 *	   in common
 */
- (BOOL)intersectsSet: (OFSet*)set;

#ifdef OF_HAVE_BLOCKS
/**
 * \brief Executes a block for each object in the set.
 *
 * \param block The block to execute for each object in the set
 */
- (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block;

/**
 * \brief Returns a new set, only containing the objects for which the block
 *	  returns YES.
 *

Modified src/ObjFW.h from [5a3fab45e8] to [fa0b5845a5].

26
27
28
29
30
31
32

33
34
35
36
37
38
39
#import "OFArray.h"

#import "OFList.h"

#import "OFDictionary.h"

#import "OFSet.h"


#import "OFEnumerator.h"

#import "OFNull.h"

#import "OFIntrospection.h"








>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFArray.h"

#import "OFList.h"

#import "OFDictionary.h"

#import "OFSet.h"
#import "OFCountedSet.h"

#import "OFEnumerator.h"

#import "OFNull.h"

#import "OFIntrospection.h"