Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class NativeParallelHashMapDataLayer<TKey, TItem>

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

    Inheritance
    object
    DataLayer
    NativeParallelHashMapDataLayer<TKey, TItem>
    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 NativeParallelHashMapDataLayer<TKey, TItem> : DataLayer, IDisposable, ICommitChanges where TKey : unmanaged, IEquatable<TKey> where TItem : unmanaged
    Type Parameters
    Name Description
    TKey

    type of the key to store data under

    TItem

    type of the data to store in the layer

    Fields

    _data

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

    Properties

    Data

    Container for the data of the layer.

    Declaration
    public NativeParallelHashMap<TKey, TItem> Data { get; }
    Property Value
    Type Description
    NativeParallelHashMap<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 data layer.

    Declaration
    public virtual void Clear()

    Dispose()

    Disposes the data layer, calls DisposeAllItems() DisposeAllItems()

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

    DisposeAllItems()

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

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

    DisposeDataItem(TItem)

    Disposes the data item if it is IDisposable.

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

    data item to dispose

    GetData(TKey)

    Returns the data item stored under the specified key.

    Declaration
    public virtual TItem GetData(TKey key)
    Parameters
    Type Name Description
    TKey key

    key to get data under

    Returns
    Type Description
    TItem

    data stored under the provided key

    Init(int, Allocator)

    Initializes/Reinitializes the data layer with the specified size. Requires a layer size to be specified because NativeParallelHashMap{TItem, TItem} can't be resized in Jobs.

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

    Max amount of data items in layer

    Allocator allocator

    allocator to create internal collections with

    RemoveData(TKey)

    Removes the data item stored under the specified key.

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

    key to remove data under

    SetData(TKey, TItem)

    Sets the data item under the specified key.

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

    key to store data under

    TItem value

    data to store under provided key

    Returns
    Type Description
    bool

    true if data was added, otherwise - false

    TryGetData(TKey, out TItem)

    Tries to get the data item stored under the specified key.

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

    key to get data under

    TItem value

    value under the provided key. If nothing found - default

    Returns
    Type Description
    bool

    true if data was found, otherwise - false

    TryRemoveData(TKey)

    Tries to remove the data item stored under the specified key.

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

    key to remove data under

    Returns
    Type Description
    bool

    true if data was in the layer, otherwise - false

    TrySetData(TKey, TItem)

    Tries to set the data item under the specified key.

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

    key to store data under

    TItem value

    data to store under the provided key

    Returns
    Type Description
    bool

    true if data was added, 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