TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Operation in Tinman.Core.Threading.Operations

Abstract base class for IOperation implementations.

abstract class Operation extends Disposable
  implements IOperation
  base of TestOperation

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<IOperation>
value [not-null] The configurator object.

ToConfig

Returns the configuration value that describes this object.

public abstract method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements IConfigurable.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Public / Attributes

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Name

Returns the human-readable name of this background operation.

public abstract property Name { get }
type string
value [not-null] The name.
implements IOperation.Name

ShallCancel

Shall the background operation cancel?

public property ShallCancel { get }
type bool
value true if the operation shall cancel, false if not.
implements IOperation.ShallCancel

Remarks:

Once Cancel has been called, this property will return true.

Weight

The weight of this operation.

public virtual property Weight { get }
type int32
value [0..100] The weight of this operation.
implements IOperation.Weight

Remarks:

This value is only used for reporting progress when combining multiple operations.

Public / Constructors

Checksum

Creates an MD5 checksum (*.md5. like Unix md5sum) for the given file.

[OwnerReturn]
public static method Checksum (Path file)
type IOperation
params file [not-null] Path to file for which to compute an MD5 checksum.
returns [not-null] The operation.

Remarks:

The operation will create a new file in the same directory as file:

some_input_file.txt -> some_input_file.md5

Copy

Copies zero or more files.

[OwnerReturn]
public static method Copy (Path file, Path dir, bool resume = false)
type IOperation
params file [not-null] The source file path. The last path element may contain wildcards.
  dir [not-null] The target directory path.
  resume Resume copy operation if target file already exists? Defaults to false.
returns [not-null] The operation.

Delete

Deletes zero or more existing files.

[OwnerReturn]
public static method Delete (Path file)
type IOperation
params file [not-null] The file path. The last path element may contain wildcards.
returns [not-null] The operation.

Flush

Returns an IOperation that calls Flush.

[OwnerReturn]
public static method Flush (IFlushable flushable)
type IOperation
params flushable [not-null] The flushable object.
returns [not-null] The operation.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

And

Returns an IOperation object that simultaneously executes this operation and the given one.

[OwnerReturn, OwnerThis]
public virtual method And ([Owner] IOperation operation)
type IOperation
params operation [not-null] The other operation.
returns [not-null] The resulting IOperation object.
implements IOperationOps.And

Cancel

Requests that the running background operation gracefully terminates.

public virtual method Cancel ()
implements IOperation.Cancel

Remarks:

An IOperation is free to honor a cancel request or to ignore it. Cancelling a background operation should be considered as a hint to terminate as soon as possible.

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

Run

Runs the operation.

public abstract method Run (IProgressMonitor progress)
params progress [not-null] The progress monitor object to use.
implements IOperation.Run

Then

Returns an IOperation object that executes this operation, followed by the given operation.

[OwnerReturn, OwnerThis]
public virtual method Then ([Owner] IOperation operation)
type IOperation
params operation [not-null] The other operation.
returns [not-null] The resulting IOperation object.
implements IOperationOps.Then

Validate

Validates the state of this object.

public virtual method Validate (Validator validator)
params validator [not-null] The validator object.
implements IValidatable.Validate

Protected / Methods

DisposeManaged

Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.

protected virtual method DisposeManaged ()
inherited Disposable.DisposeManaged

Remarks:

This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.

Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.

The DisposeManaged method is called before the DisposeUnmanaged method.

DisposeUnmanaged

Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.

protected virtual method DisposeUnmanaged ()
inherited Disposable.DisposeUnmanaged

Remarks:

Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.

The DisposeUnmanaged method is called after the DisposeManaged method.

RunSubOperation

Runs the given IOperation as a child of this operation.

protected static method RunSubOperation ([Owner] IOperation operation, IProgressMonitor progressMonitor)
params operation [not-null] The sub-operation to run.
  progressMonitor [not-null] The progress monitor to use.

Remarks:

The given operation will be disposed after it has finished.