TROArray
From RemObjects Software
This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.
Overview
TROArray forms the base class for all array types defined in your library.
Use Case
You will usually not instantiate instances of this class itself, but use the descendant classes that will be auto-generated in your _Intf unit for every array defined in your RODL file. These descendant classes will contain strongly-typed properties and methods to access the array elements as defined in your RODL.
File
- uROTypes
Declaration
TROArray = class(TROComplexType);
Hierarchy
- TCollectionItem
- TROComplexType
- TROArray
- TROComplexType
Properties
| | | |
|---|---|---|
| Count | integer | Returns the number of elements contained in the array. |
Methods
| | |
|---|---|
| Clear | Empties the entire array and sets its size to zero. If the elements of the array are structs, binaries or other arrays, they will be freed before the array is cleared. |
| Clone | 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. |
| Resize | 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. |
See Also
Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)
Lists — Glossary — Features — How To — Components — Tools — Samples — Articles — Architecture — Issues
Categories: Text | RemObjects SDK | Architecture | Class | Delphi
