/// <summary> /// Adds the (key, value) pair to the map, returning true if the element was added, or false if the element was already present and has been overwritten /// </summary> public void Add(IntPtr key, IntPtr value, ref FScriptMapLayout layout, HashDelegates.GetKeyHash getKeyHash, HashDelegates.Equality keyEqualityFn, HashDelegates.ConstructAndAssign keyConstructAndAssignFn, HashDelegates.ConstructAndAssign valueConstructAndAssignFn, HashDelegates.Assign valueAssignFn, HashDelegates.Destruct destructKeyFn, HashDelegates.Destruct destructValueFn) { Native_FScriptMap.Add(ref this, key, value, ref layout, getKeyHash, keyEqualityFn, keyConstructAndAssignFn, valueConstructAndAssignFn, valueAssignFn, destructKeyFn, destructValueFn); }
public FScriptMapHelper(IntPtr mapProperty, IntPtr map) { this.mapProperty = mapProperty; this.map = (FScriptMap *)map; mapLayout = Native_UMapProperty.Get_MapLayout(mapProperty); keyProp = Native_UMapProperty.Get_KeyProp(mapProperty); keySize = Native_UProperty.Get_ElementSize(keyProp); keyArrayDim = Native_UProperty.Get_ArrayDim(keyProp); valueProp = Native_UMapProperty.Get_ValueProp(mapProperty); valueSize = Native_UProperty.Get_ElementSize(valueProp); valueArrayDim = Native_UProperty.Get_ArrayDim(valueProp); }
/// <summary> /// Finds the associated value from hash of Key, rather than linearly searching /// </summary> public IntPtr FindValue(IntPtr key, ref FScriptMapLayout layout, HashDelegates.GetKeyHash getKeyHash, HashDelegates.Equality keyEqualityFn) { return(Native_FScriptMap.FindValue(ref this, key, ref layout, getKeyHash, keyEqualityFn)); }
public void Rehash(ref FScriptMapLayout layout, HashDelegates.GetKeyHash getKeyHash) { Pairs.Rehash(ref layout.SetLayout, getKeyHash); }
/// <summary> /// Adds an uninitialized object to the map. /// The map will need rehashing at some point after this call to make it valid. /// </summary> /// <returns>The index of the added element.</returns> public int AddUninitialized(ref FScriptMapLayout layout) { return(Pairs.AddUninitialized(ref layout.SetLayout)); }
public void RemoveAt(int index, ref FScriptMapLayout layout) { Pairs.RemoveAt(index, ref layout.SetLayout); }
public void Empty(int slack, ref FScriptMapLayout layout) { Pairs.Empty(slack, ref layout.SetLayout); }
public IntPtr GetData(int index, ref FScriptMapLayout layout) { return(Pairs.GetData(index, ref layout.SetLayout)); }