The different types of casts which are supported in the interface of the objects.
Casts are mostly used to change a pointer pointing to type a into a pointer pointing to type b. a and b must be structural compatible. They both must have the same members (type + name).
Type Casts | The different types of casts which are supported in the interface of the objects. |
casting pointers | |
genericcast_TYPE | If an interface subtype is constructed with help of TYPE_it_DECLARE it is compatible with TYPE_it. |
FROMTYPEcast_TYPE | The same as genericcast except that function FROMTYPEcast_TYPE(...) |
cast_TYPE | If you do not need a generic cast and have only one FROMTYPEcast_TYPE you can rename it into cast_TYPE. |
asTOTYPE | This cast reverses the type conversion. |
genericcast_TYPE | If an interface subtype is constructed with help of TYPE_it_DECLARE it is compatible with TYPE_it. |
FROMTYPEcast_TYPE | The same as genericcast except that function FROMTYPEcast_TYPE(...) |
cast_TYPE | If you do not need a generic cast and have only one FROMTYPEcast_TYPE you can rename it into cast_TYPE. |
asTOTYPE | This cast reverses the type conversion. |
This cast reverses the type conversion. The function asTOTYPE_TYPE converts a pointer to TYPE into a pointer to TOTYPE. It is considered an extension of TOTYPE. The same functionality could be achieved with function TYPEcast_TOTYPE implemented as part of the interface of TOTYPE. Therefore it is encouraged to implement always TYPEcast_TOTYPE even in another module. Type extensions will be supported by the upcoming language “transactional C”.