Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:34 Go to next message
Shingyu Kang is currently offline Shingyu KangFriend
Messages: 5
Registered: December 2017
Junior Member
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 15:13 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
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 15:26 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
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: Fri Dec 13 07:02:12 GMT 2024

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

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

Back to the top