-
Notifications
You must be signed in to change notification settings - Fork 0
API Host BondingGetter
Script object wrapper for a ClrGetterDelegate.
Namespace: AuroraScript.Runtime.Types. Kind: class.
Back to .NET Host API Reference
BondingGetter exposes a host-computed value as a script property. Each read calls the wrapped ClrGetterDelegate, which writes into the ref result slot, so the value can be produced on demand instead of stored.
A minimal use of BondingGetter.
ClrGetterDelegate answer = (
ScriptObject target,
ref ScriptDatum result) =>
{
result = ScriptDatum.FromNumber(42);
};
var getter = new BondingGetter(answer);BondingGetter(ClrGetterDelegate callback)Wraps a host getter delegate as a script-readable value.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
callback |
ClrGetterDelegate |
Yes | Callback invoked by the runtime on each read. |
Returns
A new BondingGetter instance.
var getter = new BondingGetter(answer);string NameGetter name reported to scripts.
Parameters
None.
Returns
Returns string.
Console.WriteLine(getter.Name);void Invoke(ScriptObject @object, ref ScriptDatum result)Invokes the wrapped getter for the supplied object.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
object |
ScriptObject |
Yes | Object the property is read from. |
result |
ref ScriptDatum |
Yes | Slot receiving the read value. |
Returns
None.
Behavior
The runtime normally calls Invoke on property access; a host calls it directly only when reading the value outside script execution.
var result = ScriptDatum.Null;
getter.Invoke(hostObject, ref result);AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License