Hi,
I’m familiarizing myself with RTSC and curious how the following lines of code (from ti\sdo\ipc\MessageQ.c) work:
ti_sdo_ipc_MessageQ_Object *obj = (ti_sdo_ipc_MessageQ_Object *)handle;
......
/* Signal the synchronizer */
ISync_signal(obj->synchronizer);
Mainly, the call to ISync_signal() is referencing an interface and is not directly implemented in any “ISync.c” file (as expected for an interface). The call must eventually get tied to the underlying implementation module that inherits ISync. Do calls to interface functions only work when the calling code is itself a RTSC module implementation (in this case the MessageQ module)? Would it be possible to call ISync_signal() or any other interface function from my own .c file if I so desired?
In my application, I have several modules that implement/inherit an interface. I would like to be able to call a common function regardless of which module I'm using. I'm not sure if a proxy or a call similar to the one above is the appropriate thing to do. Here's a summary of my application modules:
IMessageRouting Interface --> defines the SendMessage() function.
InternalMessageRouting and ExternalMessageRouting are two implementations of IMessageRouting.
I have a linked list of IMessageRouting_Handles, some InternalMessageRouting and some ExternalMessageRouting.
In my application, I create a IMessageRouting_Handle variable called currentMessageRouter to iterate through the linked list of IMessageRouting_Handles.
Can I call IMessageRouting_SendMessage( currentMessageRouter) and have the underlying module type known ? Is a proxy factory required for this?
Thanks,
Nick