Is there a way to know the clientId of the set/get caller?

31 views
Skip to first unread message

Swami Dhyan Anurag

unread,
Oct 1, 2021, 10:11:03 AM10/1/21
to Franca
Hello group,

Is there a way to know the clientId of the caller of attribute setter/getter? Basically, I am trying to achieve a use case where only a specific client can set an attribute, while others can only get.

I am storing the clientId of the owner client by forcing (usage protocol :) ) it to subscribe to a 'broadcast event' which requires passing a moduleID, an enumeration, and the rest of other clients are not allowed to subscribe.

CommonAPI generates trySetXAttribute(), setXAttribute(const std::shared_ptr<CommonAPI::ClientId> _client, ...). When setValue() or setValueAsync() is called setXAttribute() i called which first void the clientId pointer and then called trySetXAttribute().


Regards,
anurag

Klaus Birken

unread,
Oct 1, 2021, 10:24:54 AM10/1/21
to Franca
Hi,

unfortunately I cannot respond to CommonAPI-C++ related questions, as my experience with practical use of CommonAPI is a bit outdated. Usually this forum is focused on Franca IDL and the tooling, but not the code generation from Franca models.

But maybe some experienced CommonAPI  user is listening in and can respond to the question?

Regards,
Klaus
Reply all
Reply to author
Forward
0 new messages