Skip to content

TBoldObjectList

A list of Bold objects

Unit: BoldSystem

Declaration

TBoldObjectList = class(TBoldList)

Hierarchy

  1. TObject
  2. TBoldMemoryManagedObject
  3. TBoldFlaggedObject
  4. TBoldSubscribableObject
  5. TBoldElement
  6. TBoldDomainElement
  7. TBoldMember
  8. TBoldList
  9. TBoldObjectList
  10. Direct subclasses
  11. TBoldAbstractDirtyList
  12. TBusinessClassesRootList

Description

Apart from being a list of Bold objects, TBoldObjectList also offers methods for manipulating the list as a list of TBoldObjectLocators. Using these methods can be more efficient, as the objects won't have to be fetched from persistent storage.

Properties

Name Summary Notes
Adjusted Bold-internal
BoldObjects The objects in the list
BoldRoleRTInfo read-only
Locators The locators of the objects in the list.
SubscribeToLocatorsInList If the list should detect, and automatically remove, locators that are freed.
SubscribeToObjectsInList If the list should automatically remove objects that are deleted.

Adjusted

property Adjusted: Boolean;

Bold-internal

BoldObjects

property BoldObjects[index:Integer]: TBoldObject;

The objects in the list

BoldRoleRTInfo

property BoldRoleRTInfo: TBoldRoleRTInfo;

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

Locators

property Locators[index:Integer]: TBoldObjectLocator;

The locators of the objects in the list.

SubscribeToLocatorsInList

property SubscribeToLocatorsInList: Boolean;

When this property is false, the list will not detect if any of its locators are destroyed. This is only useful if you know that it will never happen (otherwise you will get dangling references, and loads of problems).

See Also

  • Subscriptions

SubscribeToObjectsInList

property SubscribeToObjectsInList: Boolean;

Set this property to False if you need a list that can hold deleted objects, or if the automatic removal upsets your looping. Default is True.

See Also

  • Subscriptions

Methods

Name Summary Notes
Add Adds a Bold object to the list
AddElement Overrides TBoldList.AddElement protected, override
AddList Overrides TBoldList.AddList override
AddLocator Adds an object by using its locator.
AllocateData Overrides TBoldList.AllocateData protected, override
Assign Overrides TBoldElement.Assign override
AtTime Overrides TBoldMember.AtTime override
CanInsert Overrides TBoldList.CanInsert override
CanInsertLocator Same as CanInsert, but takes a locator instead
CanSet Overrides TBoldList.CanSet override
CanSetLocator Same as CanSet, but takes a locator instead
CreateObjectIdList Creates an object id list, containing the object ids of the objects in the list.
CreateTypedList Obsolete
EnsureObjects Fetches several objects in one operation.
EnsureRange Fetches several objects in one operation. override
FillFromIDList Adds the objects with the ids in IdList.
FreeContent Overrides TBoldMember.FreeContent protected, override
FreeData Overrides TBoldList.FreeData protected, override
GetByIndex Lookup using qualifiers
GetByIndexAndSubscribe Same as GetByIndex, but also places subscriptions
GetCount Overrides TBoldList.GetCount protected, override
GetElement Overrides TBoldList.GetElement protected, override
GetStreamName Overrides TBoldMember.GetStreamName protected, override
Includes Same as TBoldList.Includes, but typed as TBoldObject.
IncludesElement Overrides TBoldList.IncludesElement. protected, override
IndexOf Same as TBoldList.IndexOf, but typed as TBoldObject
IndexOfElement Overrides TBoldList.IndexOfElement. protected, override
IndexOfLocator Same as IndexOf, but takes a locator instead.
InitializeMember Overrides TBoldMember.InitializeMember. protected, override
Insert Same as TBoldList.Insert, but types as a TBoldObject.
InsertElement Overrides TBoldList.InsertElement. protected, override
InsertLocator Same as Insert, but takes a locator instead.
InsertNew Overrides TBoldList.InsertNew. override
InternalAddNew Overrides TBoldList.InternalAddNew. protected, override
InternalClear protected, override
InternalCreateClassList Bold-internal
LocatorInList Indicates if the object with a given locator is in the list.
Move Overrides TBoldList.Move. override
ObserverMayModify Overrides TBoldElement.ObserverMayModify. override
ProxyClass Overrides TBoldMember.ProxyClass. protected, override
ProxyInterface Overrides TBoldElement.ProxyInterface. override
RemoveByIndex Overrides TBoldList.RemoveByIndex. override
SetElement Overrides TBoldList.SetElement protected, override

Add

procedure Add(BoldObject: TBoldObject);

Same as Add, except that the argument is typed as a TBoldObject.

AddElement

procedure AddElement(Element: TBoldElement); override; See also Ancestor Method

Overrides AddElement

AddList

procedure AddList(List: TBoldList); override; See also Ancestor Method

Overrides AddList

AddLocator

procedure AddLocator(NewLocator: TBoldObjectLocator);

Adds the locator NewLocator, and thus indirectly the Bold object associated with the locator, to the list. This may be a useful optimization if you don't actually need to fetch the object's data.

AllocateData

procedure AllocateData; override; See also Ancestor Method

Overrides AllocateData

Assign

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

If Source is a TBoldObjectList, then the objects in source will be added to the list. Objects not in Source will be removed from the list.

AtTime

function AtTime(Time: TBoldTimestampType): TBoldMember; override; See also Ancestor Method

Overrides AtTime

CanInsert

function CanInsert(index: Integer; Element: TBoldElement; Subscriber: TBoldSubscriber): Boolean; override; See also Ancestor Method

See CanInsert

CanInsertLocator

function CanInsertLocator(index: Integer; Locator: TBoldObjectLocator; Subscriber: TBoldSubscriber): Boolean;

Returns True if Locator may be inserted in position **index** in the list. A programmer can disallow Insert by subscribing to the bqMayInsert query. If a Subscriber is passed to the function, subscriptions will be placed to notify when the result of MayInsert may have changed.

CanSet

function CanSet(index: Integer; Element: TBoldElement; Subscriber: TBoldSubscriber): Boolean; override; See also Ancestor Method

See CanSet

CanSetLocator

function CanSetLocator(index: Integer; Locator: TBoldObjectLocator; Subscriber: TBoldSubscriber): Boolean;

Returns True if the locator in position **index** in the list may be replaced by Locator. This corresponds to assigning to the Locators array property. A programmer can disallow this by subscribing to the bqMayReplace query. If a Subscriber is passed to the function, subscriptions will be placed to notify when the result of MayReplace may have changed.

CreateObjectIdList

function CreateObjectIdList: TBoldObjectIdList;

Creates an object id list, containing the object ids of the objects in the list. Ownership of the id list is passed to the caller.

CreateTypedList

constructor CreateTypedList(ObjectClass: TBoldObjectClass);

Obsolete. If you want to create an object list for a specific class, use the generated list type instead (such as TPersonList, for the class TPerson).

EnsureObjects

procedure EnsureObjects;

If some of the objects in the list are not loaded, these will be fetched from persistent storage. This can increase efficiency as all objects are fetched in one operation, rather than one at a time.

EnsureRange

procedure EnsureRange(FromIndex: integer; ToIndex: integer); override; See also Ancestor Method

Same as EnsureObjects, except that only the objects between FromIndex and ToIndex are fetched.

FillFromIDList

procedure FillFromIDList(ObjectIdList: TBoldObjectIdList; BoldSystem: TBoldSystem);

The objects who's object ids are in IdList will be added to the list. Objects that are already in the list remain.

FreeContent

procedure FreeContent; override; See also Ancestor Method

Overrides FreeContent

FreeData

procedure FreeData; override; See also Ancestor Method

Overrides FreeData

GetByIndex

function GetByIndex(MemberList: TBoldMemberList): TBoldObject;

If the object list corresponds to a qualified association, this function will return the object that is qualified by the values in the member list. It is usually easier to use the qualified property on the owning object instead such as aBank.Accounts['anAccountNumber'].

GetByIndexAndSubscribe

function GetByIndexAndSubscribe(MemberList: TBoldMemberList; Subscriber: TBoldSubscriber): TBoldObject;

Same as GetByIndex, but also places subscriptions

See Also

  • Subscriptions

GetCount

function GetCount: Integer; override; See also Ancestor Method

Overrides GetCount

GetElement

function GetElement(index: Integer): TBoldElement; override; See also Ancestor Method

Overrides GetElement

GetStreamName

function GetStreamName: String; override; See also Ancestor Method

Overrides GetStreamName

Includes

function Includes(BoldObject: TBoldObject): Boolean;

Same as Includes, but typed as TBoldObject.

IncludesElement

function IncludesElement(Item: TBoldElement): Boolean; override; See also Ancestor Method

Overrides IncludesElement

IndexOf

function IndexOf(BoldObject: TBoldObject): Integer;

Return the position of BoldObject in the list, or -1 if the item is not in the list. If there are multiple occurences of BoldObject, IndexOf will return the index of the first occurence.

IndexOfElement

function IndexOfElement(Item: TBoldElement): Integer; override; See also Ancestor Method

Overrides IndexOfElement.

IndexOfLocator

function IndexOfLocator(Locator: TBoldObjectLocator): Integer;

Same as IndexOf, but takes a locator instead.

InitializeMember

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

Overrides InitializeMember.

Insert

procedure Insert(index: Integer; BoldObject: TBoldObject);

Same as Insert, but typed as a TBoldObject.

InsertElement

procedure InsertElement(index: Integer; Element: TBoldElement); override; See also Ancestor Method

Overrides InsertElement.

InsertLocator

procedure InsertLocator(index: Integer; Locator: TBoldObjectLocator);

Same as Insert, but takes a locator instead.

InsertNew

procedure InsertNew(index: Integer); override; See also Ancestor Method

Overrides InsertNew.

InternalAddNew

function InternalAddNew: TBoldElement; override; See also Ancestor Method

Overrides InternalAddNew.

InternalClear

procedure InternalClear; override; See also Ancestor Method

InternalCreateClassList

constructor InternalCreateClassList(System: TBoldSystem; ListTypeInfo: TBoldListTypeINfo);

Bold-internal

LocatorInList

function LocatorInList(NewLocator: TBoldObjectLocator): Boolean;

This method is often the fastest way to test if an object is in the list. Since the list is indexed, LocatorInList is faster than using IndexOf. Also, LocatorInList does not fetch the object.

Move

procedure Move(CurIndex, NewIndex: Integer); override; See also Ancestor Method

Overrides Move.

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 ProxyInterface.

RemoveByIndex

procedure RemoveByIndex(index: Integer); override; See also Ancestor Method

Overrides RemoveByIndex.

SetElement

procedure SetElement(index: Integer; Value: TBoldElement); override; See also Ancestor Method

Overrides SetElement


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.