MBVariableDeclaration Class Reference
| Inherits from | MBConditionalDeclaration : MBDataModel : MBFormattedDescriptionObject |
|---|---|
| Declared in | MBVariableDeclaration.h |
Overview
A partially-implemented root class that represents a variable declared in MBML.
The MBConcreteVariableDeclaration, MBSingletonVariableDeclaration, and
MBDynamicVariableDeclaration classes provide specific implementations.
Variable information
name
Returns the name of the variable.
@property (nullable, nonatomic, readonly) NSString *nameDeclared In
MBVariableDeclaration.h
isReadOnly
Returns YES if the variable contains a read-only value.
@property (nonatomic, readonly) BOOL isReadOnlyDeclared In
MBVariableDeclaration.h
disallowsValueCaching
Returns YES if the variable’s value should not be cached by the
MBVariableSpace. By definition, such variables are also read-only.
@property (nonatomic, readonly) BOOL disallowsValueCachingDeclared In
MBVariableDeclaration.h
Accessing variable values
– initialValueInVariableSpace:error:
Returns the initial value of the variable in the given variable space.
- (nullable id)initialValueInVariableSpace:(nonnull MBVariableSpace *)space error:(MBExpressionErrorPtrPtr)errPtrParameters
space |
The |
|---|---|
errPtr |
If non- |
Discussion
Note: This method should not be called for variables whose
disallowsValueCaching property returns YES; in such
cases, an exception is raised.
Declared In
MBVariableDeclaration.h
– currentValueInVariableSpace:error:
Returns the current value of the variable in the given variable space.
- (nullable id)currentValueInVariableSpace:(nonnull MBVariableSpace *)space error:(MBExpressionErrorPtrPtr)errPtrParameters
space |
The |
|---|---|
errPtr |
If non- |
Declared In
MBVariableDeclaration.h
Variable value change hook
– valueChangedTo:inVariableSpace:
Called when a mutable variable value has changed.
- (void)valueChangedTo:(nullable id)value inVariableSpace:(nonnull MBVariableSpace *)spaceParameters
value |
The new value of the variable. |
|---|---|
space |
The |
Declared In
MBVariableDeclaration.h