Skip to content

TBoldObjectReference

Reference to a Bold object

Unit: BoldSystem

Declaration

TBoldObjectReference = class(TBoldMember)

Hierarchy

  1. TObject
  2. TBoldMemoryManagedObject
  3. TBoldFlaggedObject
  4. TBoldSubscribableObject
  5. TBoldElement
  6. TBoldDomainElement
  7. TBoldMember
  8. TBoldObjectReference

Description

A TBoldObjectReference is a member that holds a reference to a Bold object. It is primarily used for roles with [0..1] multiplicity. Like TBoldObjectList, it has additional methods for manipulating the Bold object by its locator. This is more efficient since the Bold object does not have to be loaded into memory.

Properties

Name Summary Notes
BoldObject The object the reference refers to
BoldRoleRTInfo The model information for the object reference read-only
HasOldValues Bold-internal
Locator The locator of the referred object
OldEmbeddingOtherEndId Bold-internal read-only

BoldObject

property BoldObject: TBoldObject;

The object the reference refers to

BoldRoleRTInfo

property BoldRoleRTInfo: TBoldRoleRTInfo;

This property is the same as BoldMemberRtInfo, casted to TBoldRoleRTInfo.

HasOldValues

property HasOldValues: Boolean;

Bold-internal

Locator

property Locator: TBoldObjectLocator;

It can be more efficient to access the Locator property, than the BoldObject property, as it will not require the object to be fetched.

OldEmbeddingOtherEndId

property OldEmbeddingOtherEndId: TBoldObjectId;

Bold-internal

Methods

Name Summary Notes
Assign Overrides TBoldElement.Assign override
CanClear If it is allowed to Clear the reference
CanSet If it is allowed to set the object reference to the NewObject
CanSetLocator Same as CanSet, but takes a locator instead.
Clear Set the object reference to nil.
CompareToAs Overrides TBoldElement.CompareToAs override
CreateTypedReference Construct a TBoldObjectReference for Bold objects of type ObjectClass.
DefaultSubscribe Overrides TBoldElement.DefaultSubscribe override
Destroy Destructor override
GetAsList Overrides TBoldElement.GetAsList override
GetStreamName Overrides TBoldMember.GetStreamName protected, override
GetStringRepresentation Overrides TBoldElement.GetStringRepresentation protected, override
InitializeMember Overrides TBoldMember.InitializeMember protected, override
IsEqualAs Overrides TBoldElement.IsEqualAs override
IsEqualToValue Overrides TBoldMember.IsEqualToValue override
ObserverMayModify Overrides TBoldElement.ObserverMayModify override
ProxyClass Overrides TBoldMember.ProxyClass protected, override
ProxyInterface Overrides TBoldElement.ProxyClass override
SetStringRepresentation Overrides TBoldElement.SetStringRepresentation protected, override
SubscribeToStringRepresentation Overrides TBoldElement.SubscribeToStringRepresentation override

Assign

procedure Assign(Source: TBoldElement); override; See also Ancestor Method

A TBoldObjectReference can be assigned another TBoldObjectReference, or a TBoldObject.

CanClear

function CanClear(Subscriber: TBoldSubscriber): Boolean;

You can make CanClear return false, and thus prohibit Clear on a TBoldObjectReference, by subscribing to the bqMayClear query and returning false.

CanSet

function CanSet(NewObject: TBoldObject; Subscriber: TBoldSubscriber): Boolean;

Returns True if it is allowed to set the object reference to the NewObject. A programmer can disallow setting by subscribing to the bqMaySet query. If a Subscriber is passed to the function, subscriptions will be placed to notify when the result of CanSet may have changed. Note that the parameter to the bqMaySet query will be the locator of the NewObject, and not the NewObject itself.

See Also

  • Subscriptions

CanSetLocator

function CanSetLocator(NewLocator: TBoldObjectLocator; Subscriber: TBoldSubscriber): Boolean;

Returns True if it is allowed to set the object reference to the Bold object of NewLocator. A programmer can disallow setting by subscribing to the bqMaySet query. If a Subscriber is passed to the function, subscriptions will be placed to notify when the result of CanSetLocator may have changed.

See Also

  • Subscriptions

Clear

procedure Clear;

Set the object reference to **nil**.

CompareToAs

function CompareToAs(CompareType: TBoldCompareType; BoldElement: TBoldElement): Integer; override; See also Ancestor Method

Overrides CompareToAs. An object reference can be compared with another object reference, or a TBoldObject. The result is the same as comparing the objects, except if one of the references is **nil**. **Nil** is considered smaller than any object.

CreateTypedReference

constructor CreateTypedReference(ObjectClass: TBoldObjectClass);

Construct a TBoldObjectReference for Bold objects of type ObjectClass.

DefaultSubscribe

procedure DefaultSubscribe(Subscriber: TBoldSubscriber; RequestedEvent: TBoldEvent = breReEvaluate); override; See also Ancestor Method

The default events for a TBoldObjectReference are beValueChanged and beValueInvalid.

See Also

  • Subscriptions

Destroy

destructor Destroy; override; See also Ancestor Method

Destructor

GetAsList

procedure GetAsList(ResultList: TBoldIndirectElement); override; See also Ancestor Method

Will result in a TBoldObjectList containing the Bold object that the references refers to. If the reference is **nil**, the list will be empty.

GetStreamName

function GetStreamName: String; override; See also Ancestor Method

Overrides GetStreamName

GetStringRepresentation

function GetStringRepresentation(Representation: TBoldRepresentation): string; override; See also Ancestor Method

The string representation of a TBoldObjectReference is the string representation of the object it refers, or the empty string if **nil**

InitializeMember

procedure InitializeMember(AOwningElement: TBoldDomainElement; ElementTypeInfo: TBoldElementTypeInfo); override; See also Ancestor Method

Overrides TBoldMember

IsEqualAs

function IsEqualAs(CompareType: TBoldCompareType; BoldElement: TBoldElement): Boolean; override; See also Ancestor Method

A reference is considered equal if the object it refers is equal. Also, a **nil** reference is equal to another **nil** reference, or to **nil**.

IsEqualToValue

function IsEqualToValue(Value: IBoldValue): Boolean; override; See also Ancestor Method

Overrides IsEqualToValue. In contrast to IsEqualAs, IsEqualToValue is only true if the references refer the same object, but not if two different objects are equal (using IsEqual).

ObserverMayModify

function ObserverMayModify(Observer: TObject): Boolean; override; See also Ancestor Method

Overrides ObserverMayModify

ProxyClass

function ProxyClass: TBoldMember_ProxyClass; override; See also Ancestor Method

Overrides ProxyClass

ProxyInterface

function ProxyInterface(const IId: TGUID; Mode: TBoldDomainElementProxyMode; out Obj): Boolean; override; See also Ancestor Method

Overrides ProxyClass

SetStringRepresentation

procedure SetStringRepresentation(Representation: TBoldRepresentation; Value: string); override; See also Ancestor Method

This sets the string representation of the referred object.

SubscribeToStringRepresentation

procedure SubscribeToStringRepresentation(Representation: TBoldRepresentation; Subscriber: TBoldSubscriber; RequestedEvent: TBoldEvent = breReEvaluate); override; See also Ancestor Method

Overrides SubscribeToStringRepresentation

See Also

  • Subscriptions

Generated from the Bold 4.0 help (Help/BfD.chm) by Tools/chm2mkdocs.py; member lists reflect Bold 4.0, see the source for members added since.