COVESA / franca_ara_tools

Translation between Franca Interface Description Language and AUTOSAR XML interface description language
Eclipse Public License 2.0
41 stars 12 forks source link

Can we use std::any in fidl file #169

Open nekum109 opened 3 weeks ago

nekum109 commented 3 weeks ago

I want to use std::any in fidl file , how to define std::any datatype in fidl file

kbirken commented 3 weeks ago

Can you elaborate a bit more? Provide an example, etc. ...

nekum109 commented 3 weeks ago

I have one structure in my fidl file please find below code here instead of string can I use std::any struct sElementType { eElementName elementName eElementType elementDatatype String elementValue }

kbirken commented 3 weeks ago

Thanks for the explanation. std::any is a C++ type, and as Franca is language agnostic, you cannot use C++ types in interface definitions.

However, the general concept of std::any can be emulated in Franca by using a ByteBuffer primitive type. However, pls read the Caveat in the Franca User Guide (v0.12):

image
kbirken commented 3 weeks ago

BTW: Pls. direct requests like this which are related to Franca IDL only (and not the transformation tool between Franca and AUTOSAR which is developed here) to the Franca project on github: https://github.com/franca/franca