RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TObjectDictionary.Create Constructor (TDictionaryOwnerships, IEqualityComparer<TKey>)

Create TObjectDictionary instance.

Pascal
constructor Create(Ownerships: TDictionaryOwnerships; ACapacity: Integer = 0); overload;
constructor Create(Ownerships: TDictionaryOwnerships; const AComparer: IEqualityComparer<TKey>); overload;
constructor Create(Ownerships: TDictionaryOwnerships; ACapacity: Integer; const AComparer: IEqualityComparer<TKey>); overload;
C++
__fastcall TObjectDictionary(TDictionaryOwnerships Ownerships, int ACapacity = 0);
__fastcall TObjectDictionary(TDictionaryOwnerships Ownerships, const IEqualityComparer<TKey> AComparer);
__fastcall TObjectDictionary(TDictionaryOwnerships Ownerships, int ACapacity, const IEqualityComparer<TKey> AComparer);

This overloaded method creates a TObjectDictionary instance. 

The Ownerships parameter is a TDictionaryOwnerships that indicates whether the keys and/or values in entries are owned by the dictionary. Either the key or value or both or neither may be owned by the dictionary. If the object is owned, when the entry is removed from the dictionary, the key and/or value is freed. 

ACapacity is the initial capacity of the dictionary. 

AComparer is an equality comparator function. If not provided, the default comparator for the type is used. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!