I want to design a proto3 message from this Cesium class:Cesium Class. It is an array containing [string, double, double, double]. Is there anyway to do this?
Is there a way to have an array of multiple types in proto3?
2.5k Views Asked by stephenjk41 At
2
I don't believe you can create arbitrarily long messages like those shown in your link because your client and server must agree on the number and order of fields before transfer.
[Time, Longitude, Latitude, Height, Time, Longitude, Latitude, Height, ...]
Problem: without pre-defining many field numbers, how do I pass this many fields?
Option 1
Instead, you can create your own message type to represent a single instance:
Then use the custom type as a field. Here the
repeated
keyword indicates that you can send more than oneCartographicRadians
in theCartographicRadiansArray
.Option 2
Another approach would be to create a self-recursive message which would function closer to the stream-like format described above.