Commits

Tuukka Norri  committed c4a316b

Collections
- Changed collection creation functions so that they unconditionally create a Foundation collection, not a Core Foundation one.
- Removed the scanned memory CFAllocator because it was no longer needed.
- Removed PGTS::IdSet because it was no longer needed.

  • Participants
  • Parent commits 7dd248c

Comments (0)

Files changed (20)

File BaseTen.xcodeproj/project.pbxproj

 		534E3C7D11A77088002D49C8 /* BXSocketReachabilityObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 534E3C7B11A77088002D49C8 /* BXSocketReachabilityObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		534E3C7E11A77088002D49C8 /* BXSocketReachabilityObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E3C7C11A77088002D49C8 /* BXSocketReachabilityObserver.m */; };
 		5350CC380EFBE66500EBC328 /* PGTSCollections.h in Headers */ = {isa = PBXBuildFile; fileRef = 5350CC360EFBE66500EBC328 /* PGTSCollections.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		5350CC390EFBE66500EBC328 /* PGTSCollections.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5350CC370EFBE66500EBC328 /* PGTSCollections.mm */; };
 		53526E0A0E5D70EB00B67550 /* BXPredicateVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 53526E080E5D70EB00B67550 /* BXPredicateVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53526E0E0E5D909B00B67550 /* BXPGFromItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 539A84DA0E5B3AFF00A2625C /* BXPGFromItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53526E0F0E5D909B00B67550 /* BXPGFromItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 539A84DB0E5B3AFF00A2625C /* BXPGFromItem.m */; };
 		5392034211AEA108000E2BEC /* BXValidationLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5392034011AEA108000E2BEC /* BXValidationLock.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5392034311AEA108000E2BEC /* BXValidationLock.m in Sources */ = {isa = PBXBuildFile; fileRef = 5392034111AEA108000E2BEC /* BXValidationLock.m */; };
 		5392038611AEA8BF000E2BEC /* BXSocketDescriptorPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5392038511AEA8BF000E2BEC /* BXSocketDescriptorPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		539204CE11AEC88E000E2BEC /* BXSetFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 539204CC11AEC88E000E2BEC /* BXSetFunctions.h */; };
+		539204CF11AEC88E000E2BEC /* BXSetFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 539204CD11AEC88E000E2BEC /* BXSetFunctions.m */; };
+		539204D211AEC944000E2BEC /* NSObject+BaseTenAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 539204D011AEC944000E2BEC /* NSObject+BaseTenAdditions.h */; };
+		539204D311AEC944000E2BEC /* NSObject+BaseTenAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 539204D111AEC944000E2BEC /* NSObject+BaseTenAdditions.m */; };
+		539204D911AECE07000E2BEC /* BXArrayFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 539204D711AECE07000E2BEC /* BXArrayFunctions.m */; };
+		539204DA11AECE07000E2BEC /* BXDictionaryFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 539204D811AECE07000E2BEC /* BXDictionaryFunctions.m */; };
+		539204DD11AECEAF000E2BEC /* BXArrayFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 539204DB11AECEAF000E2BEC /* BXArrayFunctions.h */; };
+		539204DE11AECEAF000E2BEC /* BXDictionaryFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 539204DC11AECEAF000E2BEC /* BXDictionaryFunctions.h */; };
 		53937B670EFD097700510DBD /* PGTSInvocationRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 53937B650EFD097700510DBD /* PGTSInvocationRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53937B680EFD097700510DBD /* PGTSInvocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 53937B660EFD097700510DBD /* PGTSInvocationRecorder.m */; };
 		5395E7260E2F77DF006E8441 /* BXPGEntityImporter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5395E7240E2F77DF006E8441 /* BXPGEntityImporter.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53E3B1EB0E55C8D8001A99B5 /* PGTSConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 53666CB50E1CD8D20028DBEA /* PGTSConstants.m */; };
 		53E8985E1035B97D0062AA4D /* psqlscan.l in Sources */ = {isa = PBXBuildFile; fileRef = 53617F6B1035B89D003CE4F5 /* psqlscan.l */; };
 		53ED2E8E0E1AB7CB0095BE8B /* BXLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 53ED2E8C0E1AB7CB0095BE8B /* BXLogger.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		53F0BBA10EC49E3B00773BE7 /* PGTSCFScannedMemoryAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F0BB9F0EC49E3B00773BE7 /* PGTSCFScannedMemoryAllocator.h */; };
-		53F0BBA80EC4A40700773BE7 /* PGTSCFScannedMemoryAllocator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53F0BBA70EC4A40700773BE7 /* PGTSCFScannedMemoryAllocator.mm */; };
 		53F0BD9A0EC523A200773BE7 /* PGTSScannedMemoryAllocator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53F0BD990EC523A200773BE7 /* PGTSScannedMemoryAllocator.mm */; };
 /* End PBXBuildFile section */
 
 		534E3C7C11A77088002D49C8 /* BXSocketReachabilityObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXSocketReachabilityObserver.m; path = Sources/BXSocketReachabilityObserver.m; sourceTree = "<group>"; };
 		534EE22F0E53213300B079B0 /* libBaseTen.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBaseTen.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		5350CC360EFBE66500EBC328 /* PGTSCollections.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSCollections.h; path = Sources/PGTSCollections.h; sourceTree = "<group>"; };
-		5350CC370EFBE66500EBC328 /* PGTSCollections.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PGTSCollections.mm; path = Sources/PGTSCollections.mm; sourceTree = "<group>"; };
 		53526E080E5D70EB00B67550 /* BXPredicateVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPredicateVisitor.h; path = Sources/BXPredicateVisitor.h; sourceTree = "<group>"; };
 		53526E090E5D70EB00B67550 /* BXPredicateVisitor.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; name = BXPredicateVisitor.m; path = Sources/BXPredicateVisitor.m; sourceTree = "<group>"; };
 		535444130D634A47002A6C47 /* BaseTen.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BaseTen.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		5392034011AEA108000E2BEC /* BXValidationLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXValidationLock.h; path = Sources/BXValidationLock.h; sourceTree = "<group>"; };
 		5392034111AEA108000E2BEC /* BXValidationLock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXValidationLock.m; path = Sources/BXValidationLock.m; sourceTree = "<group>"; };
 		5392038511AEA8BF000E2BEC /* BXSocketDescriptorPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXSocketDescriptorPrivate.h; path = Sources/BXSocketDescriptorPrivate.h; sourceTree = "<group>"; };
+		539204CC11AEC88E000E2BEC /* BXSetFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXSetFunctions.h; path = Sources/BXSetFunctions.h; sourceTree = "<group>"; };
+		539204CD11AEC88E000E2BEC /* BXSetFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXSetFunctions.m; path = Sources/BXSetFunctions.m; sourceTree = "<group>"; };
+		539204D011AEC944000E2BEC /* NSObject+BaseTenAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+BaseTenAdditions.h"; path = "Sources/NSObject+BaseTenAdditions.h"; sourceTree = "<group>"; };
+		539204D111AEC944000E2BEC /* NSObject+BaseTenAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+BaseTenAdditions.m"; path = "Sources/NSObject+BaseTenAdditions.m"; sourceTree = "<group>"; };
+		539204D711AECE07000E2BEC /* BXArrayFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXArrayFunctions.m; path = Sources/BXArrayFunctions.m; sourceTree = "<group>"; };
+		539204D811AECE07000E2BEC /* BXDictionaryFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXDictionaryFunctions.m; path = Sources/BXDictionaryFunctions.m; sourceTree = "<group>"; };
+		539204DB11AECEAF000E2BEC /* BXArrayFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXArrayFunctions.h; path = Sources/BXArrayFunctions.h; sourceTree = "<group>"; };
+		539204DC11AECEAF000E2BEC /* BXDictionaryFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXDictionaryFunctions.h; path = Sources/BXDictionaryFunctions.h; sourceTree = "<group>"; };
 		53933EF409EBD082001D00BB /* BXInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = BXInterface.h; path = Sources/BXInterface.h; sourceTree = "<group>"; };
 		53937B650EFD097700510DBD /* PGTSInvocationRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSInvocationRecorder.h; path = Sources/PGTSInvocationRecorder.h; sourceTree = "<group>"; };
 		53937B660EFD097700510DBD /* PGTSInvocationRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSInvocationRecorder.m; path = Sources/PGTSInvocationRecorder.m; sourceTree = "<group>"; };
 		53ED2E8C0E1AB7CB0095BE8B /* BXLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXLogger.h; path = Sources/BXLogger.h; sourceTree = "<group>"; };
 		53EFE9E00BA96444008666B7 /* BaseTenAppKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = BaseTenAppKit.xcodeproj; path = BaseTenAppKit/BaseTenAppKit.xcodeproj; sourceTree = "<group>"; };
 		53EFEA950BA98028008666B7 /* BXDatabaseObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = BXDatabaseObjectPrivate.h; path = Sources/BXDatabaseObjectPrivate.h; sourceTree = "<group>"; };
-		53F0BB9F0EC49E3B00773BE7 /* PGTSCFScannedMemoryAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSCFScannedMemoryAllocator.h; path = Sources/PGTSCFScannedMemoryAllocator.h; sourceTree = "<group>"; };
-		53F0BBA70EC4A40700773BE7 /* PGTSCFScannedMemoryAllocator.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PGTSCFScannedMemoryAllocator.mm; path = Sources/PGTSCFScannedMemoryAllocator.mm; sourceTree = "<group>"; };
 		53F0BD990EC523A200773BE7 /* PGTSScannedMemoryAllocator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PGTSScannedMemoryAllocator.mm; path = Sources/PGTSScannedMemoryAllocator.mm; sourceTree = "<group>"; };
 		8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resources/Info.plist; sourceTree = "<group>"; };
 		98A6CD650F45C8420029B2C4 /* coverage-gc.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "coverage-gc.xcconfig"; sourceTree = "<group>"; };
 			children = (
 				53666CC20E1CD8D20028DBEA /* BXHOM.h */,
 				53666CC30E1CD8D20028DBEA /* BXHOM.m */,
+				539204D011AEC944000E2BEC /* NSObject+BaseTenAdditions.h */,
+				539204D111AEC944000E2BEC /* NSObject+BaseTenAdditions.m */,
 				535661CC0F025DD800920008 /* NSURL+BaseTenAdditions.h */,
 				535661CB0F025DD800920008 /* NSURL+BaseTenAdditions.m */,
 				535661CD0F025DD800920008 /* NSArray+BaseTenAdditions.h */,
 				533433B411A8AEA800B71D24 /* Network */,
 				53776B9B11A75964009F1A8E /* System event notifier */,
 				534E3C5F11A76F49002D49C8 /* Foundation additions */,
+				539204D611AECDEB000E2BEC /* Collections */,
 				538FA0240F576278005EBFAC /* BXOpenSSLCompatibility.h */,
 				53C4C3F31192EC10003FB842 /* BXCFHostCompatibility.h */,
 				5354F87A0F004A6600422613 /* BXExport.h */,
-				536C9D5F0EFD94D10041422F /* BXEnumerate.h */,
 				535661D70F02603600920008 /* BXLocalizedString.h */,
 				535661D80F02603600920008 /* BXSafetyMacros.h */,
 				53015A830FBEF18800E52C1E /* BXArraySize.h */,
 				5392034111AEA108000E2BEC /* BXValidationLock.m */,
 				53937B650EFD097700510DBD /* PGTSInvocationRecorder.h */,
 				53937B660EFD097700510DBD /* PGTSInvocationRecorder.m */,
-				5350CC360EFBE66500EBC328 /* PGTSCollections.h */,
-				5350CC370EFBE66500EBC328 /* PGTSCollections.mm */,
 				53666CD20E1CD8D20028DBEA /* PGTSScannedMemoryAllocator.h */,
 				53F0BD990EC523A200773BE7 /* PGTSScannedMemoryAllocator.mm */,
-				53F0BB9F0EC49E3B00773BE7 /* PGTSCFScannedMemoryAllocator.h */,
-				53F0BBA70EC4A40700773BE7 /* PGTSCFScannedMemoryAllocator.mm */,
 				534E3C6211A76F81002D49C8 /* Unneeded */,
 				536C9E8D0EFDAFF20041422F /* Remember to remove */,
 			);
 			name = "Socket descriptor";
 			sourceTree = "<group>";
 		};
+		539204D611AECDEB000E2BEC /* Collections */ = {
+			isa = PBXGroup;
+			children = (
+				536C9D5F0EFD94D10041422F /* BXEnumerate.h */,
+				539204CC11AEC88E000E2BEC /* BXSetFunctions.h */,
+				539204CD11AEC88E000E2BEC /* BXSetFunctions.m */,
+				539204DB11AECEAF000E2BEC /* BXArrayFunctions.h */,
+				539204D711AECE07000E2BEC /* BXArrayFunctions.m */,
+				539204DC11AECEAF000E2BEC /* BXDictionaryFunctions.h */,
+				539204D811AECE07000E2BEC /* BXDictionaryFunctions.m */,
+				5350CC360EFBE66500EBC328 /* PGTSCollections.h */,
+			);
+			name = Collections;
+			sourceTree = "<group>";
+		};
 		539758B50E1EB25F0042120A /* SQL Schema Generation */ = {
 			isa = PBXGroup;
 			children = (
 				535F235B0E8A8D5900311CB5 /* BXPGRelationshipExpressionValueType.h in Headers */,
 				535F24C00E8AA62800311CB5 /* BXPGObjectExpressionValueType.h in Headers */,
 				535F24EE0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.h in Headers */,
-				53F0BBA10EC49E3B00773BE7 /* PGTSCFScannedMemoryAllocator.h in Headers */,
 				5350CC380EFBE66500EBC328 /* PGTSCollections.h in Headers */,
 				53937B670EFD097700510DBD /* PGTSInvocationRecorder.h in Headers */,
 				536C9D600EFD94D10041422F /* BXEnumerate.h in Headers */,
 				5334324511A881F200B71D24 /* BXConnectionMonitor.h in Headers */,
 				5392034211AEA108000E2BEC /* BXValidationLock.h in Headers */,
 				5392038611AEA8BF000E2BEC /* BXSocketDescriptorPrivate.h in Headers */,
+				539204CE11AEC88E000E2BEC /* BXSetFunctions.h in Headers */,
+				539204D211AEC944000E2BEC /* NSObject+BaseTenAdditions.h in Headers */,
+				539204DD11AECEAF000E2BEC /* BXArrayFunctions.h in Headers */,
+				539204DE11AECEAF000E2BEC /* BXDictionaryFunctions.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				535F235C0E8A8D5900311CB5 /* BXPGRelationshipExpressionValueType.m in Sources */,
 				535F24C10E8AA62800311CB5 /* BXPGObjectExpressionValueType.m in Sources */,
 				535F24EF0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.m in Sources */,
-				53F0BBA80EC4A40700773BE7 /* PGTSCFScannedMemoryAllocator.mm in Sources */,
 				53F0BD9A0EC523A200773BE7 /* PGTSScannedMemoryAllocator.mm in Sources */,
-				5350CC390EFBE66500EBC328 /* PGTSCollections.mm in Sources */,
 				53937B680EFD097700510DBD /* PGTSInvocationRecorder.m in Sources */,
 				5354F7DF0F00417400422613 /* BXURLEncoding.m in Sources */,
 				5354F8840F004F9300422613 /* PGTSOids.m in Sources */,
 				534E3C7E11A77088002D49C8 /* BXSocketReachabilityObserver.m in Sources */,
 				5334324611A881F200B71D24 /* BXConnectionMonitor.m in Sources */,
 				5392034311AEA108000E2BEC /* BXValidationLock.m in Sources */,
+				539204CF11AEC88E000E2BEC /* BXSetFunctions.m in Sources */,
+				539204D311AEC944000E2BEC /* NSObject+BaseTenAdditions.m in Sources */,
+				539204D911AECE07000E2BEC /* BXArrayFunctions.m in Sources */,
+				539204DA11AECE07000E2BEC /* BXDictionaryFunctions.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

File Sources/BXArrayFunctions.h

+//
+// BXArrayFunctions.h
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <BaseTen/BXExport.h>
+
+
+BX_EXPORT id BXArrayCreateMutableWeakNonretaining ();

File Sources/BXArrayFunctions.m

+//
+// BXArrayFunctions.m
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "BXArrayFunctions.h"
+
+
+id
+BXArrayCreateMutableWeakNonretaining ()
+{
+	return [[NSPointerArray pointerArrayWithWeakObjects] retain];
+}

File Sources/BXAttributeDescription.m

 #import "BXEntityDescription.h"
 #import "BXRelationshipDescription.h"
 #import "BXPropertyDescriptionPrivate.h"
-#import "PGTSCollections.h"
 #import "BXLogger.h"
+#import "BXSetFunctions.h"
 
 
 @class BXRelationshipDescription;
 {
 	if ((self = [super initWithName: name entity: entity]))
 	{
-		mRelationshipsUsing = PGTSSetCreateMutableStrongRetainingForNSRD ();
+		mRelationshipsUsing = BXSetCreateMutableStrongRetainingForNSRD ();
 	}
 	return self;
 }

File Sources/BXDatabaseContext.m

 #import <string.h>
 #import <pthread.h>
 
-#import "PGTSCFScannedMemoryAllocator.h"
-#import "PGTSCollections.h"
+#import "BXSetFunctions.h"
+#import "BXDictionaryFunctions.h"
 #import "BXHOM.h"
-
 #import "BXDatabaseContext.h"
 #import "BXDatabaseContextPrivate.h"
 #import "BXConstants.h"
         //If this class were in a separate framework, this method should be called from the
         //framework initializer function
         [BXPGInterface initialize];
-		
-		PGTSScannedMemoryAllocator ();
     }
 }
 
 		
 	if (nil == mObjects)
 	{
-		mObjects = PGTSDictionaryCreateMutableWeakNonretainedObjects ();
+		mObjects = BXDictionaryCreateMutableWeakNonretainedObjects ();
 	}
 	
 	if (nil == mModifiedObjectIDs)

File Sources/BXDatabaseObjectModelStorage.m

 #import "BXDatabaseObjectModelStorage.h"
 #import "BXDatabaseObjectModel.h"
 #import "BXDatabaseObjectModelPrivate.h"
-#import "PGTSCollections.h"
+#import "BXDictionaryFunctions.h"
 
 
 
 {
 	if ((self = [super init]))
 	{
-		mModelsByURI = PGTSDictionaryCreateMutableWeakNonretainedObjects ();
+		mModelsByURI = BXDictionaryCreateMutableWeakNonretainedObjects ();
 	}
 	return self;
 }

File Sources/BXDictionaryFunctions.h

+//
+// BXDictionaryFunctions.h
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <BaseTen/BXExport.h>
+
+
+BX_EXPORT id BXDictionaryCreateMutableWeakNonretainedObjects ();

File Sources/BXDictionaryFunctions.m

+//
+// BXDictionaryFunctions.m
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "BXDictionaryFunctions.h"
+
+
+id
+BXDictionaryCreateMutableWeakNonretainedObjects ()
+{
+	return [[NSMapTable mapTableWithStrongToWeakObjects] retain];
+}

File Sources/BXEntityDescription.m

 #import "BXLogger.h"
 #import "BXWeakNotification.h"
 #import "BXHOM.h"
-#import "PGTSCollections.h"
+#import "BXSetFunctions.h"
 #import "BXEnumerate.h"
 #import "NSURL+BaseTenAdditions.h"
 
         mDatabaseURI = [anURI copy];
         mSchemaName = [sName copy];
 		
-		mObjectIDs = PGTSSetCreateMutableWeakNonretaining ();
-        mSuperEntities = PGTSSetCreateMutableWeakNonretaining ();
-        mSubEntities = PGTSSetCreateMutableWeakNonretaining ();
+		mObjectIDs = BXSetCreateMutableWeakNonretaining ();
+        mSuperEntities = BXSetCreateMutableWeakNonretaining ();
+        mSubEntities = BXSetCreateMutableWeakNonretaining ();
 		
 		mValidationLock = [[NSLock alloc] init];
 		mHash = ([super hash] ^ [mSchemaName hash] ^ [mDatabaseURI BXHash]);

File Sources/BXPGEntityConverter.m

 #import "NSAttributeDescription+BXPGAdditions.h"
 #import "NSRelationshipDescription+BXPGAdditions.h"
 #import "PGTSDatabaseDescription.h"
-#import "PGTSCollections.h"
+#import "BXSetFunctions.h"
 #import "BXEnumerate.h"
 #import "BXError.h"
 
 		}
 	}
 	
-	NSMutableSet* handledRelationships = PGTSSetCreateMutableStrongRetainingForNSRD ();
+	NSMutableSet* handledRelationships = BXSetCreateMutableStrongRetainingForNSRD ();
 	BXEnumerate (currentEntity, e, [entityArray objectEnumerator])
 	{
 		BXEnumerate (currentProperty, e, [[currentEntity properties] objectEnumerator])

File Sources/BXPGInterface.m

 #import "PGTSConstants.h"
 #import "PGTSOids.h"
 #import "PGTSMetadataStorage.h"
+#import "BXArrayFunctions.h"
 
 #import "BaseTen.h"
 #import "BXRelationshipDescription.h"
 					[entity setHasCapability: kBXEntityCapabilityAutomaticUpdate to: YES];
 				}
 				
-				id superEntities = [PGTSArrayCreateMutableWeakNonretaining () autorelease];
+				id superEntities = [BXArrayCreateMutableWeakNonretaining () autorelease];
 				struct table_inheritance_st ctx = {objectModel, database, superEntities};
 				[table iterateInheritedOids: &TableInheritanceCallback context: &ctx];
 				[entity setFetchedSuperEntities: superEntities];

File Sources/BXSetFunctions.h

+//
+// BXSetFunctions.h
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+#import <BaseTen/BXExport.h>
+
+
+BX_EXPORT id BXSetCreateMutableWeakNonretaining ();
+BX_EXPORT id BXSetCreateMutableStrongRetainingForNSRD (); //Has a better comparison function for NSRelationshipDescription.

File Sources/BXSetFunctions.m

+//
+// BXSetFunctions.m
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import "BXSetFunctions.h"
+#import <CoreData/CoreData.h>
+
+
+static BOOL
+EqualRelationship (void const * const value1, void const * const value2, NSUInteger (*size)(void const *item))
+{
+	BOOL retval = NO;
+	NSRelationshipDescription* r1 = (id) value1;
+	NSRelationshipDescription* r2 = (id) value2;
+	
+	NSString *n1 = nil, *n2 = nil;
+	@synchronized (r1)
+	{
+		n1 = [r1 name];
+	}
+	@synchronized (r2)
+	{
+		n2 = [r2 name];
+	}
+	
+	if ([n1 isEqualToString: n2])
+	{
+		NSEntityDescription *e1 = nil, *e2 = nil;
+		@synchronized (r1)
+		{
+			e1 = [r1 entity];
+		}
+		@synchronized (r2)
+		{
+			e2 = [r2 entity];
+		}
+		
+		if ([e1 isEqual: e2])
+			retval = YES;
+	}
+	return retval;
+}
+
+
+id
+BXSetCreateMutableWeakNonretaining ()
+{
+	return [[NSHashTable hashTableWithWeakObjects] retain];
+}
+
+
+id
+BXSetCreateMutableStrongRetainingForNSRD ()
+{
+	NSPointerFunctionsOptions options = NSPointerFunctionsStrongMemory | NSPointerFunctionsObjectPersonality;
+	NSPointerFunctions *functions = [[NSPointerFunctions alloc] initWithOptions: options];
+	[functions setIsEqualFunction: &EqualRelationship];
+
+	id retval = [[NSHashTable alloc] initWithPointerFunctions: functions capacity: 0];
+	[functions release];
+	
+	return retval;
+}

File Sources/NSObject+BaseTenAdditions.h

+//
+// NSObject+BaseTenAdditions.h
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSPointerArray (BaseTenAdditions)
+- (void) addObject: (id) anObject;
+- (NSEnumerator *) objectEnumerator;
+@end
+
+
+
+@interface NSMapTable (BaseTenAdditions)
+- (void) makeObjectsPerformSelector: (SEL) selector withObject: (id) object;
+- (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) marker;
+@end

File Sources/NSObject+BaseTenAdditions.m

+//
+// NSObject+BaseTenAdditions.m
+// BaseTen
+//
+// Copyright (C) 2008-2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+
+//By adding the methods to NSObject we don't override NSMapTable's and NSPointerArray's implementation if one gets made.
+@implementation NSObject (BaseTenAdditions)
+#pragma mark NSPointerArray additions
+- (void) addObject: (id) anObject
+{
+	if ([self respondsToSelector: @selector (addPointer:)])
+		[(id) self addPointer: anObject];
+	else
+		[self doesNotRecognizeSelector: _cmd];
+}
+
+
+- (NSEnumerator *) objectEnumerator
+{
+	id retval = nil;
+	if ([self respondsToSelector: @selector (allObjects)])
+		retval = [[(id) self allObjects] objectEnumerator];
+	else
+		[self doesNotRecognizeSelector: _cmd];
+	return retval;
+}
+
+
+#pragma mark NSMapTable additions
+
+- (void) makeObjectsPerformSelector: (SEL) selector withObject: (id) object
+{
+	NSEnumerator* e = [(id) self objectEnumerator];
+	id currentObject = nil;
+	while ((currentObject = [e nextObject]))
+		[currentObject performSelector: selector withObject: object];
+}
+
+
+- (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) marker
+{
+	NSMutableArray* retval = [NSMutableArray arrayWithCapacity: [keys count]];
+	NSEnumerator* e = [keys objectEnumerator];
+	id currentKey = nil;
+	while ((currentKey = [e nextObject]))
+	{
+		id object = [(id) self objectForKey: currentKey];
+		if (! object)
+			object = marker;
+		[retval addObject: object];
+	}
+	return retval;
+}
+@end

File Sources/PGTSCFScannedMemoryAllocator.h

-//
-// PGTSCFScannedMemoryAllocator.h
-// BaseTen
-//
-// Copyright (C) 2008 Marko Karppinen & Co. LLC.
-//
-// Before using this software, please review the available licensing options
-// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
-// us at sales@karppinen.fi. Without an additional license, this software
-// may be distributed only in compliance with the GNU General Public License.
-//
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2.0,
-// as published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-// $Id$
-//
-
-#import <CoreFoundation/CoreFoundation.h>
-#import <BaseTen/BXExport.h>
-
-
-BX_INTERNAL CFAllocatorRef PGTSScannedMemoryAllocator ();
-BX_INTERNAL CFSetCallBacks PGTSScannedSetCallbacks ();

File Sources/PGTSCFScannedMemoryAllocator.mm

-//
-// PGTSCFScannedMemoryAllocator.mm
-// BaseTen
-//
-// Copyright (C) 2008 Marko Karppinen & Co. LLC.
-//
-// Before using this software, please review the available licensing options
-// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
-// us at sales@karppinen.fi. Without an additional license, this software
-// may be distributed only in compliance with the GNU General Public License.
-//
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2.0,
-// as published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-// $Id$
-//
-
-#import "PGTSCFScannedMemoryAllocator.h"
-#import "PGTSScannedMemoryAllocator.h"
-
-
-static CFAllocatorRef gAllocator;
-
-
-static void*
-AllocateScanned (CFIndex allocSize, CFOptionFlags hint, void *info)
-{
-	return NSAllocateCollectable (allocSize, NSScannedOption | NSCollectorDisabledOption);
-}
-
-
-static void*
-ReallocateScanned (void *ptr, CFIndex newsize, CFOptionFlags hint, void *info)
-{
-	return NSReallocateCollectable (ptr, newsize, NSScannedOption | NSCollectorDisabledOption);
-}
-
-
-static void
-DeallocateScanned (void *ptr, void *info)
-{
-	free (ptr);
-}
-
-
-CFAllocatorRef 
-PGTSScannedMemoryAllocator ()
-{
-	if (! gAllocator)
-	{
-		if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-		{
-			CFAllocatorContext ctx = {
-				0,		//Version
-				NULL,	//Info
-				NULL,	//Retain ctx
-				NULL,	//Release ctx
-				NULL,	//Copy ctx description
-				&AllocateScanned,
-				&ReallocateScanned,
-				&DeallocateScanned,
-				NULL	//CFAllocatorPreferredSizeCallBack
-			};
-			gAllocator = CFAllocatorCreate (NULL, &ctx);
-		}
-		else
-		{
-			gAllocator = kCFAllocatorDefault; 
-		}
-	}
-	return gAllocator;
-}
-
-
-CFSetCallBacks 
-PGTSScannedSetCallbacks ()
-{
-	CFSetCallBacks callbacks = kCFTypeSetCallBacks;
-	if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-	{
-		callbacks.retain = NULL;
-		callbacks.release = NULL;
-	}
-	return callbacks;
-}

File Sources/PGTSCollections.h

 	
 	typedef std::list <id, PGTS::scanned_memory_allocator <id> > IdList;
 	
-	typedef std::tr1::unordered_set <id,
-		PGTS::ObjectHash, 
-		PGTS::ObjectCompare <id>, 
-		PGTS::scanned_memory_allocator <id> > 
-		IdSet;
-	
 	typedef std::tr1::unordered_set  <RetainingIdPair,
 		RetainingIdPair::Hash,
 		std::equal_to <RetainingIdPair>,
 }
 
 #define PGTS_IdList PGTS::IdList
-#define PGTS_IdSet PGTS::IdSet
 #define PGTS_IdMap PGTS::IdMap
 #define PGTS_IndexMap PGTS::IndexMap
 #define PGTS_RetainingIdPairSet PGTS::RetainingIdPairSet
 
 #else
 #define PGTS_IdList void
-#define PGTS_IdSet void
 #define PGTS_IdMap void
 #define PGTS_IndexMap void
 #define PGTS_RetainingIdPairSet void
 #endif
-
-
-BX_EXPORT id PGTSSetCreateMutableWeakNonretaining ();
-BX_EXPORT id PGTSSetCreateMutableStrongRetainingForNSRD (); //Has a better comparison function for NSRelationshipDescription.
-BX_EXPORT id PGTSArrayCreateMutableWeakNonretaining ();
-BX_EXPORT id PGTSDictionaryCreateMutableWeakNonretainedObjects ();

File Sources/PGTSCollections.mm

-//
-// PGTSCollections.m
-// BaseTen
-//
-// Copyright (C) 2008 Marko Karppinen & Co. LLC.
-//
-// Before using this software, please review the available licensing options
-// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
-// us at sales@karppinen.fi. Without an additional license, this software
-// may be distributed only in compliance with the GNU General Public License.
-//
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2.0,
-// as published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-// $Id$
-//
-
-#import <CoreData/CoreData.h>
-#import "PGTSCollections.h"
-#import "PGTSScannedMemoryAllocator.h"
-#import "PGTSCFScannedMemoryAllocator.h"
-
-const CFSetCallBacks kNonRetainingSetCallbacks = {
-	0,
-	NULL,
-	NULL,
-	&CFCopyDescription,
-	&CFEqual,
-	&CFHash
-};
-
-
-const CFArrayCallBacks kNonRetainingArrayCallbacks = {
-	0,
-	NULL,
-	NULL,
-	&CFCopyDescription,
-	&CFEqual
-};
-
-
-const CFDictionaryValueCallBacks kNonRetainingDictionaryValueCallbacks = {
-	0,
-	NULL,
-	NULL,
-	&CFCopyDescription,
-	&CFEqual
-};
-
-
-static Boolean
-EqualRelationship (const void *value1, const void *value2)
-{
-	Boolean retval = FALSE;
-	NSRelationshipDescription* r1 = (id) value1;
-	NSRelationshipDescription* r2 = (id) value2;
-	
-	NSString *n1 = nil, *n2 = nil;
-	@synchronized (r1)
-	{
-		n1 = [r1 name];
-	}
-	@synchronized (r2)
-	{
-		n2 = [r2 name];
-	}
-	
-	if ([n1 isEqualToString: n2])
-	{
-		NSEntityDescription *e1 = nil, *e2 = nil;
-		@synchronized (r1)
-		{
-			e1 = [r1 entity];
-		}
-		@synchronized (r2)
-		{
-			e2 = [r2 entity];
-		}
-		
-		if ([e1 isEqual: e2])
-			retval = TRUE;
-	}
-	return retval;
-}
-
-
-id PGTSSetCreateMutableWeakNonretaining ()
-{
-	id retval = nil;
-	if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-		retval = [NSHashTable hashTableWithWeakObjects];
-	else
-		retval = (id) CFSetCreateMutable (NULL, 0, &kNonRetainingSetCallbacks);
-	return retval;
-}
-
-
-id PGTSSetCreateMutableStrongRetainingCB (const CFSetCallBacks* callbacks)
-{
-	CFSetCallBacks cb = *callbacks;
-	CFAllocatorRef allocator = NULL;
-	
-	if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-	{
-		allocator = PGTSScannedMemoryAllocator ();
-		cb.retain = NULL;
-		cb.release = NULL;
-	}
-	else
-	{
-		cb.retain = kCFTypeSetCallBacks.retain;
-		cb.release = kCFTypeSetCallBacks.release;
-	}
-	
-	id retval = (id) CFSetCreateMutable (allocator, 0, &cb);
-	return retval;
-}
-
-
-id PGTSSetCreateMutableStrongRetainingForNSRD ()
-{
-	CFSetCallBacks cb = kCFTypeSetCallBacks;
-	cb.equal = &EqualRelationship;
-	return PGTSSetCreateMutableStrongRetainingCB (&cb);
-}
-
-
-id PGTSArrayCreateMutableWeakNonretaining ()
-{
-	id retval = nil;
-	if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-		retval = [NSPointerArray pointerArrayWithWeakObjects];
-	else
-	{
-		retval = (id) CFArrayCreateMutable (NULL, 0, &kNonRetainingArrayCallbacks);
-	}
-	return retval;
-}
-
-
-id PGTSDictionaryCreateMutableWeakNonretainedObjects ()
-{
-	id retval = nil;
-	if (PGTS::scanned_memory_allocator_env::allocate_scanned)
-		retval = [NSMapTable mapTableWithStrongToWeakObjects];
-	else
-	{
-		retval = (id) CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks, 
-												 &kNonRetainingDictionaryValueCallbacks);
-		
-	}
-	return retval;
-}
-
-
-//By adding the methods to NSObject we don't override NSMapTable's and NSPointerArray's implementation if one gets made.
-@implementation NSObject (PGTSCollectionAdditions)
-#pragma mark NSPointerArray additions
-- (void) addObject: (id) anObject
-{
-	if ([self respondsToSelector: @selector (addPointer:)])
-		[(id) self addPointer: anObject];
-}
-
-- (NSEnumerator *) objectEnumerator
-{
-	id retval = nil;
-	if ([self respondsToSelector: @selector (allObjects)])
-		retval = [[(id) self allObjects] objectEnumerator];
-	return retval;
-}
-
-
-#pragma mark NSMapTable additions
-- (void) makeObjectsPerformSelector: (SEL) selector withObject: (id) object
-{
-	NSEnumerator* e = [(id) self objectEnumerator];
-	id currentObject = nil;
-	while ((currentObject = [e nextObject]))
-		[currentObject performSelector: selector withObject: object];
-}
-
-- (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) marker
-{
-	NSMutableArray* retval = [NSMutableArray arrayWithCapacity: [keys count]];
-	NSEnumerator* e = [keys objectEnumerator];
-	id currentKey = nil;
-	while ((currentKey = [e nextObject]))
-	{
-		id object = [(id) self objectForKey: currentKey];
-		if (! object)
-			object = marker;
-		[retval addObject: object];
-	}
-	return retval;
-}
-@end

File Sources/PGTSMetadataStorage.m

 #import "PGTSMetadataStorage.h"
 #import "PGTSMetadataContainer.h"
 #import "BXLogger.h"
-#import "PGTSCollections.h"
+#import "BXDictionaryFunctions.h"
 
 
 __strong static id gSharedInstance = nil;
 {
 	if ((self = [super init]))
 	{
-		mMetadataByURI = PGTSDictionaryCreateMutableWeakNonretainedObjects ();
+		mMetadataByURI = BXDictionaryCreateMutableWeakNonretainedObjects ();
 	}
 	return self;
 }