Question on Franca IDL syntax for returning a pointer of a class object

40 views
Skip to first unread message

yopo...@gmail.com

unread,
Jan 7, 2020, 3:51:05 AM1/7/20
to Franca
Hi all,

I'm currently tasked to look into CommonAPI and Franca IDL. I did both CommonAPI Dbus and SomeIP tutorials, and now ready to move on to something more complex.
I'm trying to write .fidl file for an API that I want to use with CommonAPI. Current issue that I'm facing is:

1. My Class A has a method that returns a pointer of an object of Class B. How do I write the method in Franca IDL?

Is this something that can be done? Do I use 'structure' in place of the class?

Would appreciate if someone could help me figure this out. If you think the question is too simple, please point me to the right resource so that I can have better understanding.

Thanks,
uaz 

Klaus Birken

unread,
Jan 8, 2020, 7:54:06 AM1/8/20
to Franca
Hi uaz,

one important point of Franca interface definitions is that the data can be transported across address space boundaries, e.g., from the interface client on one processor to the service provider on another processor. Something like a pointer from one object to another cannot be transported across such boundaries easily, as the memory address the pointer is pointing to will not exist in the other address space. Therefore, this cannot be modeled with Franca IDL.

If you know that both sides of the interface will always be in the same address space, you could introduce a special type alias (e.g., named "Pointer") which maps to a string, or to some other struct-like data type. Then the implementation of this is up to the code generator. But you will loose the nice abstraction level by doing this (and CommonAPI will not know how to deal with it).

Hope this helps, regards,
Klaus
Reply all
Reply to author
Forward
0 new messages