Topic
6 replies Latest Post - ‏2013-05-16T17:17:35Z by MaitreBart
MaitreBart
MaitreBart
60 Posts
ACCEPTED ANSWER

Pinned topic Hidden accessor/mutator

‏2013-05-14T16:31:07Z |

I'm using Rhapsody 7.5.1.

I'm looking at a base and a derived classes (that I did not create).

In a method of the derived class I can see a call to an accessor (getIpAddr() method).

In Rhapsody, I cannot see the accessor method neither in the derived class nor the base class.

I used the debugger and was surprised to see that the generated produced the code for both the "hidden"  accessor and mutator in the base class.

Then I searched in the properties of the base class and could not find anything related to hiding mutator and accessor.

Can anyone explain this magic to me?

  • shanz9903
    shanz9903
    268 Posts
    ACCEPTED ANSWER

    Re: Hidden accessor/mutator

    ‏2013-05-15T08:35:01Z  in response to MaitreBart

    Two points here :-

    1) Surely there must be a property on an attribute (ipAddr ?), such as CPP_CG::Attribute::AccessorGenerate/MutatorGenerate.

    2) If you want to un-hide the autogenerated methods and show them in the Rhapsody browser, set the Project-level property CG::CGGeneral::GeneratedCodeInBrowser

    • MaitreBart
      MaitreBart
      60 Posts
      ACCEPTED ANSWER

      Re: Hidden accessor/mutator

      ‏2013-05-15T17:10:38Z  in response to shanz9903

      Both points are as you said.

      My guess at this point is that there must be a local override of the project settings where only certain attributes have their auto-generated methods hidden from the browser.

      Let me know if you have any clue.

      • shanz9903
        shanz9903
        268 Posts
        ACCEPTED ANSWER

        Re: Hidden accessor/mutator

        ‏2013-05-16T08:17:38Z  in response to MaitreBart

        So the base class doesn't have an attribute called ipAddr?

        • MaitreBart
          MaitreBart
          60 Posts
          ACCEPTED ANSWER

          Re: Hidden accessor/mutator

          ‏2013-05-16T13:17:32Z  in response to shanz9903

          Sorry, yes it does, as per other attributes. But it appears "ipAddr" is not the only one to have its getters/setters hidden in the browser but generated in the source code; the other attributes react the same way.

          I provided a screenshot of the base class' CPP_CG attribute and operation properties (rhap_bclass_prop_cppcg_attr1.png and rhap_bclass_prop_cppcg_oper1.png). And the ipAddr's CPP_CG attribute properties (rhap_ipaddr_prop_cppcg_attr1.png).

          Note the package containing the classes was copied recently from a project in reference by the main project directly into the main project itself (and that referenced package scoped out of the component of course).

          • shanz9903
            shanz9903
            268 Posts
            ACCEPTED ANSWER

            Re: Hidden accessor/mutator

            ‏2013-05-16T15:38:32Z  in response to MaitreBart

            Seems OK to me.  You can either hide all auto-generated methods or show them all using the CG::CGGeneral::GeneratedCodeInBrowser.

            The ipAddr attribute has CPP_CG::Attrribute::AccessorGenerate ticked so that is why you get the method in the source code.

            • MaitreBart
              MaitreBart
              60 Posts
              ACCEPTED ANSWER

              Re: Hidden accessor/mutator

              ‏2013-05-16T17:17:35Z  in response to shanz9903

              The project's CG::CGGeneral::GeneratedCodeInBrowser is checked. So I wonder why the accessors/mutators are not showing in the browser?

              The situation is this one: if I don't see an accessor in the list of operation, then I will create one manually. This duplicates unnecessary code. We want to avoid that.