Reflection¶
Include: Use System\Reflection.pkg
Reflection inspects runtime value types, struct metadata, array metadata, stack arguments, and function return-call information.
Handles returned by StructTypeOf, ArrayTypeOf, and related APIs are metadata handles for the running program. Invalid handles, wrong value types, and out-of-range indexes raise a DataFlex error.
Value and call inspection¶
- DfType identifies DataFlex runtime value types returned by Reflection APIs.
- TypeOf returns the
DfTypeconstant for a value. - Get_Stack_Argument reads an argument from the current call stack frame.
- TypeOfCallInfo reports the declared return value type requested by the caller.
- StructTypeOfCallInfo returns struct metadata for a struct return call.
- ArrayTypeOfCallInfo returns array metadata for an array return call.
Struct metadata¶
- StructTypeOf returns a metadata handle for a struct value.
- StructName returns the struct type name for a struct metadata handle.
- StructMemberCount returns the number of members in a struct metadata handle.
- StructMemberType returns the
DfTypeconstant for a struct member. - StructMemberName returns the public member name for a struct member.
- StructMember returns a struct member value by index.
- StructSetMember writes a struct member by index.
- CreateStructFromType creates a new struct value from struct metadata.
- StructTypeOfStruct returns nested struct metadata for a struct member.
- StructTypeOfArray returns array metadata for a struct member that is an array.
Array metadata¶
- ArrayTypeOf returns a metadata handle for an array value.
- ArrayDimensionCount returns the number of dimensions for an array metadata handle.
- ArrayDimentionSize returns the declared size for a fixed array dimension.
- ValueTypeOfArray returns the
DfTypeconstant for array elements. - ArrayInstanceSize returns the current element count for an array value.
- ArrayElementByIndex returns an array element by index.
- SetArrayElementByIndex writes an array element by index.
- CreateArrayFromType creates an array value from array metadata.
- ArrayTypeOfArray returns nested array metadata for arrays whose element type is array.
- ArrayTypeOfStruct returns struct metadata for arrays whose element type is struct.