From: <fas...@us...> - 2006-02-03 04:15:23
|
Revision: 577 Author: fastbike2 Date: 2006-02-02 20:14:57 -0800 (Thu, 02 Feb 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=577&view=rev Log Message: ----------- Added new public property RefItems to TInstantReferences. This is an indexed property that returns the TInstantObjectReference from the internal list, allowing you to get a list of referenced object IDs without retrieving them. Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2006-02-03 03:10:51 UTC (rev 576) +++ trunk/Source/Core/InstantPersistence.pas 2006-02-03 04:14:57 UTC (rev 577) @@ -1084,6 +1084,7 @@ function GetObjectReferenceList: TInstantObjectReferenceList; property ObjectReferenceList: TInstantObjectReferenceList read GetObjectReferenceList; + function GetRefItems(Index: Integer): TInstantObjectReference; protected class function AttributeType: TInstantAttributeType; override; function GetAllowOwned: Boolean; override; @@ -1113,6 +1114,7 @@ procedure SaveReferencesToStream(AStream: TStream); property AllowOwned write SetAllowOwned; property Connector write FConnector; + property RefItems[Index: Integer]: TInstantObjectReference read GetRefItems; end; TInstantObjectState = class(TPersistent) @@ -7180,6 +7182,11 @@ Result := FObjectReferenceList; end; +function TInstantReferences.GetRefItems(Index: Integer): TInstantObjectReference; +begin + Result := ObjectReferenceList.RefItems[Index]; +end; + function TInstantReferences.InternalAdd(AObject: TInstantObject): Integer; begin Result := ObjectReferenceList.Add(AObject); |