Search Results for

    Show / Hide Table of Contents

    Class RefCountVector

    RefCountedVector is used to keep track of which indices in a linear index list are in use/referenced. A free list is tracked so that unreferenced indices can be re-used.

    The enumerator iterates over valid indices (ie where refcount > 0)

    refcounts are shorts so the maximum count is 65536. No overflow checking is done in release builds.

    Inheritance
    Object
    RefCountVector
    Implements
    IEnumerable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: g3
    Assembly: cs.temp.dll.dll
    Syntax
    public class RefCountVector : IEnumerable

    Constructors

    RefCountVector()

    Declaration
    public RefCountVector()

    RefCountVector(RefCountVector)

    Declaration
    public RefCountVector(RefCountVector copy)
    Parameters
    Type Name Description
    RefCountVector copy

    RefCountVector(Int16[], Boolean)

    Declaration
    public RefCountVector(short[] raw_ref_counts, bool build_free_list = false)
    Parameters
    Type Name Description
    Int16[] raw_ref_counts
    Boolean build_free_list

    Fields

    invalid

    Declaration
    public static readonly short invalid
    Field Value
    Type Description
    Int16

    Properties

    count

    Declaration
    public int count { get; }
    Property Value
    Type Description
    Int32

    empty

    Declaration
    public bool empty { get; }
    Property Value
    Type Description
    Boolean

    is_dense

    Declaration
    public bool is_dense { get; }
    Property Value
    Type Description
    Boolean

    max_index

    Declaration
    public int max_index { get; }
    Property Value
    Type Description
    Int32

    RawRefCounts

    Declaration
    public DVector<short> RawRefCounts { get; }
    Property Value
    Type Description
    DVector<Int16>

    UsageStats

    Declaration
    public string UsageStats { get; }
    Property Value
    Type Description
    String

    Methods

    allocate()

    Declaration
    public int allocate()
    Returns
    Type Description
    Int32

    allocate_at(Int32)

    allocate at specific index, which must either be larger than current max index, or on the free list. If larger, all elements up to this one will be pushed onto free list. otherwise we have to do a linear search through free list. If you are doing many of these, it is likely faster to use allocate_at_unsafe(), and then rebuild_free_list() after you are done.

    Declaration
    public bool allocate_at(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Boolean

    allocate_at_unsafe(Int32)

    allocate at specific index, which must be free or larger than current max index. However, we do not update free list. So, you probably need to do rebuild_free_list() after calling this.

    Declaration
    public bool allocate_at_unsafe(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Boolean

    debug_print()

    Declaration
    public string debug_print()
    Returns
    Type Description
    String

    decrement(Int32, Int16)

    Declaration
    public void decrement(int index, short decrement = 1)
    Parameters
    Type Name Description
    Int32 index
    Int16 decrement

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator

    increment(Int32, Int16)

    Declaration
    public int increment(int index, short increment = 1)
    Parameters
    Type Name Description
    Int32 index
    Int16 increment
    Returns
    Type Description
    Int32

    isValid(Int32)

    Declaration
    public bool isValid(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Boolean

    isValidUnsafe(Int32)

    Declaration
    public bool isValidUnsafe(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Boolean

    rawRefCount(Int32)

    Declaration
    public int rawRefCount(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Int32

    rebuild_free_list()

    Declaration
    public void rebuild_free_list()

    refCount(Int32)

    Declaration
    public int refCount(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    Int32

    set_Unsafe(Int32, Int16)

    Declaration
    public void set_Unsafe(int index, short count)
    Parameters
    Type Name Description
    Int32 index
    Int16 count

    trim(Int32)

    Declaration
    public void trim(int maxIndex)
    Parameters
    Type Name Description
    Int32 maxIndex

    Implements

    System.Collections.IEnumerable
    In This Article
    Back to top ViRGIS VR GIS