You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This assumes XCDR2 is used; XCDR1 has not been inspected. Example IDL:
// Currently: A delimiter is added to the outer dim.
// Expected: No delimiter for the whole array.
typedef long PrimArray[2];
struct PrimTypedefStruct {
PrimArray arr[2];
};
struct A {
long l;
};
// Currently: One delimiter for the outer dim, one for each element in the inner dim.
// Expected: Only 1 delimiter for the whole array.
typedef A Array[2];
struct TypedefStruct {
Array arr[2];
};
First, the spec is not clear as to whether an alias type is respected or flattened when used as the element type of an array. Consider the first example. If PrimArray is resolved to long[2], arr would have type long[2][2] and thus has no delimiter. If PrimArray alias type is considered as the base type of arr, arr would have a delimiter since PrimArray is not primitive. The second example is similar.
The team agreed that aliases should be flattened for serialization since alias is typically treated transparently and shouldn't have an impact on serialization otherwise one could make serialization of basically the same type arbitrarily large by adding multiple typedefs for its members or elements. So this assumes flattening alias types is the correct approach for the rest of the report.
Second, opendds_idl currently doesn't flatten the alias types when encountering multi-dimensional arrays as in the example IDL above. In particular, for the first example, a delimiter is added while there should be no delimiter. In the second example, there is a delimiter for the outer dimension and one delimiter for each element of type Array while there should be only one delimiter for the whole array.
Multi-dimensional arrays of primitive or non-primitive element types without aliasing seem to be handled correctly, for example
// No delimiter is added to the array.
struct PrimMDimStruct {
long arr[2][2];
};
// There is 1 delimiter for the outer dim since the element is non-primitive.
struct MultiDimStruct {
A arr[2][2];
};
Single-dimensional arrays also seem to be handled correctly even when using aliases.
The text was updated successfully, but these errors were encountered:
"Table 6 – Alias types" from the spec may be a helpful piece of the puzzle as to what the spec actually requires.
Based on this I would say that the spec does indicate (perhaps not clearly) that typedef can't change the encoding.
"Table 6 – Alias types" from the spec may be a helpful piece of the puzzle as to what the spec actually requires. Based on this I would say that the spec does indicate (perhaps not clearly) that typedef can't change the encoding.
Yeah, the second paragraph implies that. Okay, that's more clear now.
This assumes XCDR2 is used; XCDR1 has not been inspected. Example IDL:
First, the spec is not clear as to whether an alias type is respected or flattened when used as the element type of an array. Consider the first example. If
PrimArray
is resolved tolong[2]
,arr
would have typelong[2][2]
and thus has no delimiter. IfPrimArray
alias type is considered as the base type ofarr
,arr
would have a delimiter sincePrimArray
is not primitive. The second example is similar.The team agreed that aliases should be flattened for serialization since alias is typically treated transparently and shouldn't have an impact on serialization otherwise one could make serialization of basically the same type arbitrarily large by adding multiple typedefs for its members or elements. So this assumes flattening alias types is the correct approach for the rest of the report.
Second,
opendds_idl
currently doesn't flatten the alias types when encountering multi-dimensional arrays as in the example IDL above. In particular, for the first example, a delimiter is added while there should be no delimiter. In the second example, there is a delimiter for the outer dimension and one delimiter for each element of typeArray
while there should be only one delimiter for the whole array.Multi-dimensional arrays of primitive or non-primitive element types without aliasing seem to be handled correctly, for example
Single-dimensional arrays also seem to be handled correctly even when using aliases.
The text was updated successfully, but these errors were encountered: