Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    IReferencable Interface

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

    Base interface for all referencable objects.

    public interface IReferencable
    Name Description
    Properties
    ReferenceCount

    Gets the reference count of this instance.

    Methods
    AddReference()

    Increments the reference count of this instance.

    Release()

    Decrements the reference count of this instance.

    | Improve this Doc View Source

    Properties


    ReferenceCount

    Gets the reference count of this instance.

    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.

    int AddReference()
    Returns
    Type Description
    System.Int32

    The method returns the new reference count.


    Release()

    Decrements the reference count of this instance.

    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