Delphi XE5, RemObjects SDK for Delphi and all Clients 8.3.93.1183
RODLStruct AutoCreateParams defines “if the described object has the ability to autocreate fields”.
When AutoCreateParams is enabled:
- Delphi CodeGen follows this rule and autocreates field in property getter.
- C# CodeGen ignores AutoCreateParams and leaves field unassigned in property getter.
As a result we have generated classes with asymmetric behavior.
Is it a bug?
Example:
RODL file extras:
<Struct Name="AddressData" AutoCreateParams="1">
<Elements>
<Element Name="Country" DataType="WideString"/>
...
</Elements>
</Struct>
<Struct Name="CustomerData" AutoCreateParams="1">
<Elements>
<Element Name="DeliveryAddress" DataType="AddressData"/>
<Element Name="InvoiceAddress" DataType="AddressData"/>
...
</Elements>
</Struct>
Delphi CodeGen (OK):
CustomerData = class(TROComplexType)
private
function GetDeliveryAddress: AddressData;
…
function CustomerData.GetDeliveryAddress: AddressData;
begin
if (fDeliveryAddress = nil) then fDeliveryAddress := AddressData.Create();
Result := fDeliveryAddress;
end;
C# CodeGen (???):
class CustomerData : ComplexType {
public virtual AddressData DeliveryAddress {
get {
return @__DeliveryAddress;
}
…
}
}