System.Rtti.TRttiIndexedProperty.GetValue

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function GetValue(Instance: Pointer; const Args: array of TValue): TValue;

C++

TValue __fastcall GetValue(void * Instance, const TValue *Args, const int Args_High);

Propriétés

Type Visibilité  Source Unité  Parent
function public
System.Rtti.pas
System.Rtti.hpp
System.Rtti TRttiIndexedProperty

Description

Renvoie la valeur d'un élément spécifique de la collection représentée par cette instance de TRttiIndexedProperty.

GetValue renvoie un TValue représentant la valeur de la propriété pour un index spécifique.

Les paramètres sont décrits dans le tableau ci-dessous :

Nom Description
Instance L'instance cible de la classe ayant des propriétés indexées.
Args Informations sur l'index.

Exemple (Delphi) :

TCar = class public
  function GetDoor(Index1: Integer; Index2: Integer): Pointer;
  property Door[Index1: Integer; Index2: Integer]: Pointer read GetDoor;
end;

// ...

APointer := TRttiIndexedPropertyInstance.GetValue(TCarInstance, [SomeValueForIndex1, SomeValueForIndex2]);

Voir aussi