Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    StreamableResource Class

    Namespace: Stride.Streaming
    Assembly: Stride.Rendering.dll

    Base class for all resources that can be dynamicly streamed.

    System.Object → DisposeBase → ComponentBase → StreamableResource
    Derived from StreamableResource: StreamingTexture

    public abstract class StreamableResource : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
    Name Description
    Constructors
    StreamableResource(StreamingManager)
    Fields
    cancellationToken
    fileProvider
    StreamingOptions

    The current streaming options of the resource.

    Properties
    AllocatedResidency

    Gets the allocated residency level.

    CurrentResidency

    Gets the current residency level.

    IsAllocated

    Gets a value indicating whether this resource is allocated.

    Manager

    Gets the manager.

    MaxResidency

    Gets the maximum residency level.

    Resource

    Gets the resource object.

    Storage

    Gets the resource storage.

    TargetResidency

    Gets the target residency level.

    Methods
    CalculateRequestedResidency(Int32)

    Calculates the requested residency level for this resource based on a given target residency. Resource can control how to change it's residency up/down and if do it at once or in steps, etc.. This gives more control over per resource streaming.

    CalculateTargetResidency(StreamingQuality)

    Calculates the target residency level for this resource based on a given uniform quality.

    Destroy()

    Disposes of object resources.

    Init(IDatabaseFileProviderService, ContentStorage)
    StopStreaming()

    Stops the resource streaming using cancellation token.

    StreamAsync(Int32)

    Stream resource to the target residency level.

    | Improve this Doc View Source

    Constructors


    StreamableResource(StreamingManager)

    protected StreamableResource(StreamingManager manager)
    Parameters
    Type Name Description
    StreamingManager manager
    | Improve this Doc View Source

    Fields


    cancellationToken

    protected CancellationTokenSource cancellationToken
    Field Value
    Type Description
    System.Threading.CancellationTokenSource

    fileProvider

    protected DatabaseFileProvider fileProvider
    Field Value
    Type Description
    DatabaseFileProvider

    StreamingOptions

    The current streaming options of the resource.

    public StreamingOptions? StreamingOptions
    Field Value
    Type Description
    System.Nullable<StreamingOptions>
    | Improve this Doc View Source

    Properties


    AllocatedResidency

    Gets the allocated residency level.

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

    CurrentResidency

    Gets the current residency level.

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

    IsAllocated

    Gets a value indicating whether this resource is allocated.

    public bool IsAllocated { get; }
    Property Value
    Type Description
    System.Boolean

    Manager

    Gets the manager.

    public StreamingManager Manager { get; }
    Property Value
    Type Description
    StreamingManager

    MaxResidency

    Gets the maximum residency level.

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

    Resource

    Gets the resource object.

    public abstract object Resource { get; }
    Property Value
    Type Description
    System.Object

    Storage

    Gets the resource storage.

    public ContentStorage Storage { get; }
    Property Value
    Type Description
    ContentStorage

    TargetResidency

    Gets the target residency level.

    public int TargetResidency { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Methods


    CalculateRequestedResidency(Int32)

    Calculates the requested residency level for this resource based on a given target residency. Resource can control how to change it's residency up/down and if do it at once or in steps, etc.. This gives more control over per resource streaming.

    public abstract int CalculateRequestedResidency(int targetResidency)
    Parameters
    Type Name Description
    System.Int32 targetResidency

    The target residency.

    Returns
    Type Description
    System.Int32

    Requested residency.


    CalculateTargetResidency(StreamingQuality)

    Calculates the target residency level for this resource based on a given uniform quality.

    public abstract int CalculateTargetResidency(StreamingQuality quality)
    Parameters
    Type Name Description
    StreamingQuality quality

    The quality.

    Returns
    Type Description
    System.Int32

    Target residency.


    Destroy()

    Disposes of object resources.

    protected override void Destroy()
    Overrides
    ComponentBase.Destroy()

    Init(IDatabaseFileProviderService, ContentStorage)

    protected void Init(IDatabaseFileProviderService databaseFileProviderService, ContentStorage storage)
    Parameters
    Type Name Description
    IDatabaseFileProviderService databaseFileProviderService
    ContentStorage storage

    StopStreaming()

    Stops the resource streaming using cancellation token.

    public void StopStreaming()

    StreamAsync(Int32)

    Stream resource to the target residency level.

    protected abstract Task StreamAsync(int residency)
    Parameters
    Type Name Description
    System.Int32 residency

    The target residency.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Inherited Members

    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

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

    Back to top

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