Class PipelineWorkerBase
Inheritance
Implements
Namespace: Holoride.ElasticSDK
Assembly: Holoride.ElasticSDK.Library.Runtime.dll
Syntax
public abstract class PipelineWorkerBase : IPipelineWorker
Properties
CurrentGenerationContext
Gets or sets the current generation context.
Declaration
public GenerationContext CurrentGenerationContext { get; set; }
Property Value
Type | Description |
---|---|
GenerationContext |
GenerationSettings
Gets the immutable data that cannot be changed during the whole generation loop.
Declaration
public GenerationSettings GenerationSettings { get; }
Property Value
Type | Description |
---|---|
GenerationSettings |
GenerationState
Gets the current state of the generation process and will be updated over time.
Declaration
public GenerationState GenerationState { get; }
Property Value
Type | Description |
---|---|
GenerationState |
HasMissingMandatoryInputInHierarchy
Gets a value indicating whether this worker has any missing mandatory input in hierarchy.
Declaration
public bool HasMissingMandatoryInputInHierarchy { get; }
Property Value
Type | Description |
---|---|
bool |
Inputs
Gets the input IPipelineWorkers to be processed before this worker.
Declaration
public IEnumerable<IPipelineWorker> Inputs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IPipelineWorker> |
IsGatheringResources
Gets or sets a value indicating whether this node is gathering resources.
Declaration
public bool IsGatheringResources { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsProcessing
Gets or sets a value indicating whether this node is processing.
Declaration
public bool IsProcessing { get; set; }
Property Value
Type | Description |
---|---|
bool |
MissingMandatoryInputs
Gets all missing mandatory inputs.
Declaration
public IReadOnlyCollection<string> MissingMandatoryInputs { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<string> |
Pipeline
Gets or sets the pipeline this worker currently belongs to. A worker can always only belong to a single pipeline.
Declaration
public Pipeline Pipeline { get; set; }
Property Value
Type | Description |
---|---|
Pipeline |
Methods
AddInput(string, IPipelineWorker)
Adds an input PipelineWorker.
Declaration
public void AddInput(string id, IPipelineWorker pipelineWorker)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the input. |
IPipelineWorker | pipelineWorker | The PipelineWorker to set as an input. |
AddMissingMandatoryInput(string)
Adds a missing input.
Declaration
public void AddMissingMandatoryInput(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the missing input. |
CallCleanUp()
Cleans up this node.
Declaration
[Obsolete("Use Dispose() instead.")]
public virtual void CallCleanUp()
CallGatherResourcesAsync(GenerationContext, IProgress<float>, CancellationToken)
Gathers the resources required for this node in order to be processed.
Declaration
public virtual UniTask<LoadResourceResult> CallGatherResourcesAsync(GenerationContext context, IProgress<float> onProgressUpdate = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
GenerationContext | context | Contains the immutable meta-information of a single update iteration. |
IProgress<float> | onProgressUpdate | The feedback function passing the (down)loading progress [0, 1]. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask<T><LoadResourceResult> |
CallInit()
Initializes this node.
Declaration
public virtual void CallInit()
CallInitResources()
Initializes the resources required for this node in order to be processed.
Declaration
public virtual void CallInitResources()
CallProcessAsync(GenerationContext, IProgress<float>, CancellationToken)
The default process function that is called for every CompositingNode.
Declaration
public virtual UniTask CallProcessAsync(GenerationContext context, IProgress<float> onProgressUpdate = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
GenerationContext | context | Contains the immutable meta-information of a single update iteration. |
IProgress<float> | onProgressUpdate | Called with relative progress in [0, 1]. May be called from another thread. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask |
CleanUp()
Declaration
[Obsolete("Use Dispose() instead.")]
public virtual void CleanUp()
Dispose()
Declaration
public virtual void Dispose()
GatherResourcesAsync(GenerationContext, IProgress<float>, CancellationToken)
Gathers resources for this node.
Declaration
protected virtual UniTask<LoadResourceResult> GatherResourcesAsync(GenerationContext context, IProgress<float> onProgressUpdate, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GenerationContext | context | Contains the immutable meta-information of a single update iteration. |
IProgress<float> | onProgressUpdate | Called with current relative processing progress in [0, 1]. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask<T><LoadResourceResult> |
GetInput(string)
Gets an input PipelineWorker.
Declaration
public IPipelineWorker GetInput(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the input. |
Returns
Type | Description |
---|---|
IPipelineWorker | The corresponding input PipelineWorker. |
GetInput<T>(string)
Declaration
public T GetInput<T>(string id) where T : class, IPipelineWorker
Parameters
Type | Name | Description |
---|---|---|
string | id |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Init()
Initializes this worker when generation starts.
Declaration
public virtual void Init()
InitResources()
Initializes the resources required for this node in order to be processed.
Declaration
public virtual void InitResources()
ProcessAsync(GenerationContext, IProgress<float>, CancellationToken)
Processes this node.
Declaration
protected virtual UniTask ProcessAsync(GenerationContext context, IProgress<float> onProgressUpdate, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GenerationContext | context | Contains the immutable meta-information of a single update iteration. |
IProgress<float> | onProgressUpdate | Called with current relative processing progress in [0, 1]. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Cysharp.Threading.Tasks.UniTask |