Esempio n. 1
0
 /// <summary>
 /// This method calculates an identifier for the objects added to an SplObjectStorage object.
 /// </summary>
 /// <remarks>
 /// The implementation in SplObjectStorage returns the same value as spl_object_hash().
 ///
 /// The storage object will never contain more than one object with the same identifier.
 /// As such, it can be used to implement a set(a collection of unique values) where
 /// the quality of an object being unique is determined by the value returned by this function being unique.
 /// </remarks>
 public virtual string getHash(object @object) => (@object != null) ? SplObjects.object_hash_internal_string(@object) : string.Empty;   // see spl_object_hash()
Esempio n. 2
0
 public static IntStringKey MakeKey(object obj) => new IntStringKey(SplObjects.object_hash_internal(obj));