Skip to main content



      Home
Home » Eclipse Projects » Papyrus for Real Time » IsQuery attribute adds const only to header, not to implemention
IsQuery attribute adds const only to header, not to implemention [message #1777638] Fri, 01 December 2017 02:34 Go to next message
Eclipse UserFriend
Hi,

If a passive class is added as a parameter to a signal,
the parameter type is declared as const&.
So some member functions needs to be declared as "is query".

If I check "is query" attribute to a member function of a class (not capsule),
"const" is added the function in its header file.

int getFunctionConst() const;

But "const" is not added to the its body function as follows.
int ConstClass::getFunctionConst()
{ ... }

So compiling fails.

Thanks.
Shingyu Kang
Re: IsQuery attribute adds const only to header, not to implemention [message #1777882 is a reply to message #1777638] Tue, 05 December 2017 10:13 Go to previous messageGo to next message
Eclipse UserFriend
Shingyu Kang wrote on Fri, 01 December 2017 02:34
Hi,

If a passive class is added as a parameter to a signal,
the parameter type is declared as const&.
So some member functions needs to be declared as "is query".


I'm not sure I understand. Passive classes do not have signals. Do you mean an operation?

Also, declaring the type of a parameter to be const& is not related to the operation being a query or not. Can you clarify what you mean? Perhaps with your model?

In any case, this doesn't seem to be related to the problem:

Shingyu Kang wrote on Fri, 01 December 2017 02:34
Hi,
If I check "is query" attribute to a member function of a class (not capsule),
"const" is added the function in its header file.

int getFunctionConst() const;

But "const" is not added to the its body function as follows.
int ConstClass::getFunctionConst()
{ ... }

So compiling fails.


I've tested this, and indeed this is a bug. In fact, the problem seems to occur with capsules as well, not just passive classes.

Unfortunately I don't have a workaround at the moment.

I'll open a bug for this.

Re: IsQuery attribute adds const only to header, not to implemention [message #1777885 is a reply to message #1777882] Tue, 05 December 2017 10:26 Go to previous message
Eclipse UserFriend
I've opened Bug 528160 for this.
Previous Topic:Can't syncronize code to uml file
Next Topic:Duplicate internal signals are generated if a state has sub-states
Goto Forum:
  


Current Time: Sat May 24 07:20:45 EDT 2025

Powered by FUDForum. Page generated in 0.19009 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top