|
|
|
|
Re: Deleted assignment operator overloading getting overwritten/changed (C++)? [message #1853223 is a reply to message #1852940] |
Thu, 23 June 2022 11:57 |
|
Dear Manuel,
I can (mostly) reproduce the issue. There are multiple elements
1. A behavior can only be assigned to at most one operation, otherwise its specification reference would be non deterministic. Therefore, the UML2 plugin removes a method from an existing operation, if you add it to another. This is correct.
2. When a class has an owned behavior without specification, the C++ generator emits the information "// opaque behavior without specification" prior to a C++ method declaration that uses the name and parameters of the opaque behavior instead of an associated operation. However, in my case, I get the original code instead of an empty one. It can be discussed whether the generator should ignore a behavior without specification. Anyway, the behavior of the generator in this case needs to be documented which is currently not the case.
3. The synchronization mechanism does not establish the link between an operation and a method of the same name, if the link does not already exist. In can be discussed as well, whether the synchronization mechanism should do that automatically.
Ansgar
[Updated on: Thu, 23 June 2022 13:11] Report message to a moderator
|
|
|
Re: Deleted assignment operator overloading getting overwritten/changed (C++)? [message #1853278 is a reply to message #1853223] |
Sat, 25 June 2022 19:11 |
Manuel Malagon Messages: 81 Registered: December 2011 |
Member |
|
|
Ansgar
Ok, yeah, there are lots of behaviors of papyrus I don't fully understand. I thought that the association was made just by name but as you mention that is not the case.
I was able to fix my issue with the three points you provided. I just realized that indeed my ~Main behavior didn't have its correct specification and that is what was causing all the mess. As soon as I added its specification then all the "problems" I described in this forum post stopped happening!!
I just have one more observation though. After adding the correct specification to the ~Main behavior and the code was not automatically changed anymore the only issue I still had was the Main::~Main() method code was still being erased. The way I solve this was to paste the code in the C++ text box from the behavior properties as shown here:
I guess that's fine because now everything works well but I just wanted to ask, is this required? Shouldn't I be able to just normally type the code in the CDT editor and save the file as opposed to write it, copy it, and paste it in the properties window in order to not have it deleted when I execute Designer > Generate code>?
[Updated on: Sat, 25 June 2022 19:13] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04134 seconds