TROArray<T>

Overview

Location

 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  overload override    (declared in TROComplexType)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

Add  overload

function Add: T

Add (T): Integer  overload

function Add(const Value: T): Integer

Parameters:

  • Value:

Assign  override

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clear  override

procedure Clear

Clone    (declared in TROArray)

Will create and return a second copy of the Array. The new instance will be a deep copy of the original array; if the members are structs, binaries or arrays themselves, they too will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent of the original class.

function Clone: TROArray

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

Count

property Count: Integer read

Delete (Integer)  override

procedure Delete(aIndex: Integer)

Parameters:

  • aIndex:

Delete (Integer)  virtual abstract    (declared in TROArray)

Deletes the i-th element of the array. If it is struct, binary or other array, it will be freed before the element is deleted.

procedure Delete(Index: Integer)

Parameters:

  • Index: Index

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

FreeInternalProperties  protected virtual    (declared in TROComplexType)

procedure FreeInternalProperties

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetCount  protected override

function GetCount: Integer

GetEnumerator

function GetEnumerator: TROArrayEnumerator

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

GetIndex (string, Variant, Integer, TROSearchOptions): Integer  override

function GetIndex(const aPropertyName: string; const aPropertyValue: Variant; StartFrom: Integer; Options: TROSearchOptions): Integer

Parameters:

  • aPropertyName:
  • aPropertyValue:
  • StartFrom:
  • Options:

GetIndex (T, Integer): Integer  overload

function GetIndex(const aValue: T; const aStartFrom: Integer): Integer

Parameters:

  • aValue:
  • aStartFrom:

GetItemClass  override

class function GetItemClass: TClass

GetItemRef (Integer): Pointer  override

function GetItemRef(aIndex: Integer): Pointer

Parameters:

  • aIndex:

GetItemRef (Integer): Pointer  virtual abstract    (declared in TROArray)

Returns the pointer to the array element specified by the index.

function GetItemRef(Index: Integer): Pointer

Parameters:

  • Index: Item position

GetItems  protected

function GetItems(aIndex: Integer): T

Parameters:

  • aIndex:

GetItemSize  override

class function GetItemSize: Integer

GetItemType  override

class function GetItemType: PTypeInfo

Grow  protected virtual

procedure Grow

IndexOf

function IndexOf(const aValue: T; const aStartFrom: Integer): Integer

Parameters:

  • aValue:
  • aStartFrom:

InnerArray

property InnerArray: TArray<T> read

IntResize  protected override

procedure IntResize(ElementCount: Integer; AllocItems: Boolean)

Parameters:

  • ElementCount:
  • AllocItems:

Items

property Items[Index: Integer]: T read write

ReadComplex  override    (declared in TROArray)

Deserializes current class instance using provided serializer.

procedure ReadComplex(ASerializer: TObject)

Parameters:


Resize    (declared in TROArray)

Resizes the array to the specified size.

Since arrays are not a very dynamic data structure, repeatedly adding single elements can be a costly procedure, since memory needs to be reallocated for the grown array with each addittion. If the final size of the array is known in advance, it will perform better if you size it to the proper count in advance, and then simply fill the new vacancies.

procedure Resize(ElementCount: Integer)

Parameters:

  • ElementCount: new size

SaveToJson  protected override    (declared in TROArray)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected override    (declared in TROArray)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

Searches item with specified properties

function Search(const aPropertyName: string; const aPropertyValue: Variant; StartFrom: Integer; Options: TROSearchOptions): TCollectionItem

Parameters:

  • aPropertyName: property name
  • aPropertyValue: property value
  • StartFrom: index
  • Options: options

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SetItemRef (Integer, Pointer)  override

procedure SetItemRef(aIndex: Integer; Ref: Pointer)

Parameters:

  • aIndex:
  • Ref:

SetItemRef (Integer, Pointer)  virtual    (declared in TROArray)

MUST be overwritten for arrays of non-simple types.

procedure SetItemRef(Index: Integer; Ref: Pointer)

Parameters:

  • Index: Item position
  • Ref: Reference to object

SetItems  protected virtual

procedure SetItems(aIndex: Integer; const Value: T)

Parameters:

  • aIndex:
  • Value:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

WriteComplex  override    (declared in TROArray)

Serializes current class instance using provided serializer.

procedure WriteComplex(ASerializer: TObject)

Parameters:

 

ContentAsJson    (declared in TROComplexType)

property ContentAsJson: UnicodeString read

ContentAsString    (declared in TROComplexType)

Returns the structure of the type in a string format.

property ContentAsString: string read

ContentAsXml    (declared in TROComplexType)

Returns the XML structure of the type in a string format.

property ContentAsXml: ROUTF8String read

Count

property Count: Integer read

FieldCount    (declared in TROComplexType)

property FieldCount: Integer read

FieldInfo    (declared in TROComplexType)

property FieldInfo[Index: Integer]: PTypeInfo read

FieldName    (declared in TROComplexType)

property FieldName[Index: Integer]: string read

InnerArray

property InnerArray: TArray<T> read

Items

property Items[Index: Integer]: T read write

 

GetAttributeCount  virtual    (declared in TROComplexType)

Returns the number of custom attributes defined for the class.

class function GetAttributeCount: Integer

GetAttributeName  virtual    (declared in TROComplexType)

Returns the name of custom attribute defined for the class, with the specified index.

class function GetAttributeName(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetAttributeValue  virtual    (declared in TROComplexType)

Returns the value of custom attribute defined for the class, with the specified index.

class function GetAttributeValue(aIndex: Integer): string

Parameters:

  • aIndex: The index of attribute.

GetItemClass  override

class function GetItemClass: TClass

GetItemSize  override

class function GetItemSize: Integer

GetItemType  override

class function GetItemType: PTypeInfo

TryGetAttribute    (declared in TROComplexType)

class function TryGetAttribute(aName: string; out aValue: string): Boolean

Parameters:

  • aName:
  • aValue:

 

constructor Create  reintroduce overload virtual    (declared in TROComplexType)

Creates a new instance.

constructor Create

constructor Create (TCollection)  overload override    (declared in TROComplexType)

Creates a new instance with given parameter.

constructor Create(aCollection: TCollection)

Parameters:

  • aCollection: collection

Add  overload

function Add: T

Add (T): Integer  overload

function Add(const Value: T): Integer

Parameters:

  • Value:

Assign  override

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

AssignTo  override    (declared in TROComplexType)

Copies the properties of an object to a destination object.

procedure AssignTo(iDest: TPersistent)

Parameters:

  • iDest: destination object.

Clear  override

procedure Clear

Clone    (declared in TROArray)

Will create and return a second copy of the Array. The new instance will be a deep copy of the original array; if the members are structs, binaries or arrays themselves, they too will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent of the original class.

function Clone: TROArray

Clone    (declared in TROComplexType)

Creates and returns a second copy of the struct.

The new instance will be a deep copy of the original struct, all nested members that are arrays, structs or binaries will be duplicated as part of the cloning process, so that the new instance and its members will be completely independent from the original class.

function Clone: TROComplexType

Delete (Integer)  override

procedure Delete(aIndex: Integer)

Parameters:

  • aIndex:

Delete (Integer)  virtual abstract    (declared in TROArray)

Deletes the i-th element of the array. If it is struct, binary or other array, it will be freed before the element is deleted.

procedure Delete(Index: Integer)

Parameters:

  • Index: Index

FreeInternalProperties  protected virtual    (declared in TROComplexType)

procedure FreeInternalProperties

GetContentAsJson    (declared in TROComplexType)

function GetContentAsJson(aIncludeExtraInfo: Boolean): UnicodeString

Parameters:

  • aIncludeExtraInfo:

GetContentAsXml    (declared in TROComplexType)

function GetContentAsXml(aOffset: Integer): ROUTF8String

Parameters:

  • aOffset:

GetCount  protected override

function GetCount: Integer

GetEnumerator

function GetEnumerator: TROArrayEnumerator

GetFieldNames    (declared in TROComplexType)

procedure GetFieldNames(aList: TStrings)

Parameters:

  • aList:

GetFieldValue    (declared in TROComplexType)

function GetFieldValue(const aFieldName: string): Variant

Parameters:

  • aFieldName:

GetIndex (string, Variant, Integer, TROSearchOptions): Integer  override

function GetIndex(const aPropertyName: string; const aPropertyValue: Variant; StartFrom: Integer; Options: TROSearchOptions): Integer

Parameters:

  • aPropertyName:
  • aPropertyValue:
  • StartFrom:
  • Options:

GetIndex (T, Integer): Integer  overload

function GetIndex(const aValue: T; const aStartFrom: Integer): Integer

Parameters:

  • aValue:
  • aStartFrom:

GetItemRef (Integer): Pointer  override

function GetItemRef(aIndex: Integer): Pointer

Parameters:

  • aIndex:

GetItemRef (Integer): Pointer  virtual abstract    (declared in TROArray)

Returns the pointer to the array element specified by the index.

function GetItemRef(Index: Integer): Pointer

Parameters:

  • Index: Item position

GetItems  protected

function GetItems(aIndex: Integer): T

Parameters:

  • aIndex:

Grow  protected virtual

procedure Grow

IndexOf

function IndexOf(const aValue: T; const aStartFrom: Integer): Integer

Parameters:

  • aValue:
  • aStartFrom:

IntResize  protected override

procedure IntResize(ElementCount: Integer; AllocItems: Boolean)

Parameters:

  • ElementCount:
  • AllocItems:

ReadComplex  override    (declared in TROArray)

Deserializes current class instance using provided serializer.

procedure ReadComplex(ASerializer: TObject)

Parameters:


Resize    (declared in TROArray)

Resizes the array to the specified size.

Since arrays are not a very dynamic data structure, repeatedly adding single elements can be a costly procedure, since memory needs to be reallocated for the grown array with each addittion. If the final size of the array is known in advance, it will perform better if you size it to the proper count in advance, and then simply fill the new vacancies.

procedure Resize(ElementCount: Integer)

Parameters:

  • ElementCount: new size

SaveToJson  protected override    (declared in TROArray)

procedure SaveToJson(const aRoot: TROJSONValue; aIncludeExtraInfo: Boolean)

Parameters:

  • aRoot:
  • aIncludeExtraInfo:

SaveToXml  protected override    (declared in TROArray)

procedure SaveToXml(const aNode: TROConverterNode)

Parameters:

  • aNode:

Searches item with specified properties

function Search(const aPropertyName: string; const aPropertyValue: Variant; StartFrom: Integer; Options: TROSearchOptions): TCollectionItem

Parameters:

  • aPropertyName: property name
  • aPropertyValue: property value
  • StartFrom: index
  • Options: options

SetFieldValue    (declared in TROComplexType)

procedure SetFieldValue(const aFieldName: string; const aValue: Variant)

Parameters:

  • aFieldName:
  • aValue:

SetItemRef (Integer, Pointer)  override

procedure SetItemRef(aIndex: Integer; Ref: Pointer)

Parameters:

  • aIndex:
  • Ref:

SetItemRef (Integer, Pointer)  virtual    (declared in TROArray)

MUST be overwritten for arrays of non-simple types.

procedure SetItemRef(Index: Integer; Ref: Pointer)

Parameters:

  • Index: Item position
  • Ref: Reference to object

SetItems  protected virtual

procedure SetItems(aIndex: Integer; const Value: T)

Parameters:

  • aIndex:
  • Value:

SmartAssign    (declared in TROComplexType)

Copies specific data from a given source.

procedure SmartAssign(Source: TPersistent; TypeKinds: TTypeKinds)

Parameters:

  • Source: Instance whose properties will be copied
  • TypeKinds: Specifies which properties should be copied

WriteComplex  override    (declared in TROArray)

Serializes current class instance using provided serializer.

procedure WriteComplex(ASerializer: TObject)

Parameters: