Interface IObjectInstance
Represents a single live object instance — a class module's activation record, owning the storage for every instance field it declares (RD-VBAL §2.3.1.2's instance heap tier). Two instances of the same class module never share a field's storage: each gets its own independent binding, exactly as two activations of the same procedure never share a local's storage on ICallStackFrame.
public interface IObjectInstance
Remarks
⚠️ An IObjectInstance is not immutable: the value retrieved for a given
field may be different at a subsequent retrieval. Its lifetime is tracked separately, by
ISessionObjects and the VBRuntimeObjectId it was created for.
Properties
ClassModule
The VBClassModuleSymbol this is an instance of.
VBClassModuleSymbol ClassModule { get; }
Property Value
ObjectId
The identity ISessionObjects tracks this instance's lifetime under.
VBRuntimeObjectId ObjectId { get; }
Property Value
Methods
GetValue(Symbol)
Gets the IBindingHandle currently held on this instance for the specified instance field Symbol.
IBindingHandle GetValue(Symbol field)
Parameters
fieldSymbol
Returns
Exceptions
- KeyNotFoundException
No binding exists for
fieldon this instance.
Push(Symbol, VBTypedValue)
Declares field on this instance and reserves storage sized for
value, its initial value — the class's declared type default for a freshly
created instance.
void Push(Symbol field, VBTypedValue value)
Parameters
fieldSymbolvalueVBTypedValue
Exceptions
- InvalidOperationException
fieldis already declared on this instance.
TryResolve(Symbol, out IBindingHandle?)
Gets the IBindingHandle currently held on this instance for the specified instance field Symbol, if any.
bool TryResolve(Symbol field, out IBindingHandle? value)
Parameters
fieldSymbolvalueIBindingHandle