Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class NativeParallelMultiHashMapDataLayer<TKey, TItem>

    Base class for all data layers that are based on NativeParallelMultiHashMap{TItem, TItem}.

    Inheritance
    object
    DataLayer
    NativeParallelMultiHashMapDataLayer<TKey, TItem>
    ByteAreaCellsDataLayer
    Implements
    IDisposable
    ICommitChanges
    Inherited Members
    DataLayer.IsDisposableItems
    DataLayer._readJobsDependency
    DataLayer.ReadDependency
    DataLayer._writeJobsDependency
    DataLayer.WriteDependency
    DataLayer.CombinedDependency
    DataLayer._isDirty
    DataLayer.IsDirty
    DataLayer._version
    DataLayer.Version
    DataLayer.AddReadDependency(JobHandle)
    DataLayer.AddWriteDependency(JobHandle)
    DataLayer.SetReadDependency(JobHandle)
    DataLayer.SetWriteDependency(JobHandle)
    DataLayer.PrepareToWrite()
    DataLayer.PrepareToRead()
    DataLayer.OpenToRead()
    DataLayer.OpenToWrite()
    DataLayer.CompleteReadJobs()
    DataLayer.CompleteWriteJobs()
    DataLayer.CompleteAllJobs()
    DataLayer.CommitChanges()
    DataLayer.SetDirty(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.Core.DataLayers
    Assembly: fwt.core.dll
    Syntax
    public abstract class NativeParallelMultiHashMapDataLayer<TKey, TItem> : DataLayer, IDisposable, ICommitChanges where TKey : unmanaged, IEquatable<TKey> where TItem : unmanaged
    Type Parameters
    Name Description
    TKey

    Type of the key to store a data under

    TItem

    Type of the data to store in the layer

    Fields

    _data

    Declaration
    protected NativeParallelMultiHashMap<TKey, TItem> _data
    Field Value
    Type Description
    NativeParallelMultiHashMap<TKey, TItem>

    Properties

    Data

    The container for data in the layer

    Declaration
    public NativeParallelMultiHashMap<TKey, TItem> Data { get; }
    Property Value
    Type Description
    NativeParallelMultiHashMap<TKey, TItem>

    Length

    Number of items in the layer.

    Declaration
    public override int Length { get; }
    Property Value
    Type Description
    int
    Overrides
    DataLayer.Length

    Methods

    Clear()

    Clears the underlying multi hash map.

    Declaration
    public virtual void Clear()

    Dispose()

    Disposes the layer and all of it's data, calls DisposeAllItems() DisposeAllItems()

    Declaration
    public override void Dispose()
    Overrides
    DataLayer.Dispose()

    DisposeAllItems()

    Disposes all items in the layer by calling DisposeDataItem method for each item. DisposeDataItem(TItem)

    Declaration
    public override void DisposeAllItems()
    Overrides
    DataLayer.DisposeAllItems()

    DisposeDataItem(TItem)

    Disposes the item if it is IDisposable.

    Declaration
    protected virtual void DisposeDataItem(TItem item)
    Parameters
    Type Name Description
    TItem item

    Init(int, Allocator)

    Initializes/Reinitializes the data layer with the specified size. Requires a layer size, because in Jobs we need to know how much memory to allocate, so the underlying native multi hash map is created with capacity of layerSize.

    Declaration
    public virtual void Init(int layerSize, Allocator allocator = Allocator.Persistent)
    Parameters
    Type Name Description
    int layerSize

    max amount of cells in the layer

    Allocator allocator

    allocator to create an underlying collection with

    RemoveData(TKey)

    Removes a data stored under the provided key.

    Declaration
    public virtual void RemoveData(TKey key)
    Parameters
    Type Name Description
    TKey key

    key to remove a stored data under

    SetData(TKey, TItem)

    Puts a data under the provided key.

    Declaration
    public virtual void SetData(TKey key, TItem value)
    Parameters
    Type Name Description
    TKey key

    Key to put data under

    TItem value

    data to put under a provided key

    TryRemoveData(TKey)

    Tries to remove a data stored under the provided key.

    Declaration
    public virtual bool TryRemoveData(TKey key)
    Parameters
    Type Name Description
    TKey key

    key to remove a stored data under

    Returns
    Type Description
    bool

    true if data was in the layer

    TrySetData(TKey, TItem)

    Gets data stored under the provided key.

    Declaration
    public virtual bool TrySetData(TKey key, TItem value)
    Parameters
    Type Name Description
    TKey key

    key to search data under

    TItem value

    value found under provided key. If nothing is found, then default value

    Returns
    Type Description
    bool

    true if data was found, otherwise - false

    Implements

    IDisposable
    ICommitChanges

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX