Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ReferenceBase Class

    Namespace: Stride.Core
    Assembly: Stride.Core.dll

    Base class for a IReferencable class.

    System.Object → ReferenceBase
    Derived from ReferenceBase: Blob

    public abstract class ReferenceBase : IReferencable
    Name Description
    Properties
    ReferenceCount

    Gets the reference count of this instance.

    Methods
    AddReference()

    Increments the reference count of this instance.

    Destroy()

    Releases unmanaged and - optionally - managed resources

    Release()

    Decrements the reference count of this instance.

    | Improve this Doc View Source

    Properties


    ReferenceCount

    Gets the reference count of this instance.

    public int ReferenceCount { get; }
    Property Value
    Type Description
    System.Int32

    The reference count.

    | Improve this Doc View Source

    Methods


    AddReference()

    Increments the reference count of this instance.

    public virtual int AddReference()
    Returns
    Type Description
    System.Int32

    The method returns the new reference count.


    Destroy()

    Releases unmanaged and - optionally - managed resources

    protected abstract void Destroy()

    Release()

    Decrements the reference count of this instance.

    public virtual int Release()
    Returns
    Type Description
    System.Int32

    The method returns the new reference count.

    Remarks

    When the reference count is going to 0, the component should release/dispose dependents objects.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.KeepReference<T>(T)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation