Click or drag to resize

FileBackedHashSetT(String, IEnumerableT) Constructor

Creates a new instance of the FileBackedHashSetT class.

Namespace: GSF.Collections
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public FileBackedHashSet(
	string filePath,
	IEnumerable<T> enumerable
)
View Source

Parameters

filePath  String
The path to the file used to store the lookup table.
enumerable  IEnumerableT
The enumerable whose elements are copied to this hash set.
Exceptions
ExceptionCondition
ArgumentExceptionfilePath is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars.
ArgumentNullExceptionfilePath is null or enumerable is null.
InvalidOperationExceptionT cannot be serialized.
Remarks
This constructor uses the default equality comparer for file backed lookup tables, which is not the same as the default equality comparer for T objects. This is because the default implementation of GetHashCode does not provide guarantees about consistency across platforms, or even implementations of the CLR. Instead, the default equality comparer uses a byte-for-byte comparison to determine equality between keys and a CRC-32 for its hash code implementation. This means the performance of the hashing function is dependent on the performance of the serialization function.
See Also