c++rhapsody

How to model noncopyable in Rational Rhapsody 8.0.1


I want to make a class in my Rhapsody model non-copyable, but

=> so I am doing it the old fascioned way.

What I need from Rhapsody:

In this context, I want to generate only a declaration for copy ctor and copy assignment op - I don't need the implementation. Is this even possible?

Things that I considered:


Solution

  • I would suggest a stereotype approach:

    1. Create a NonCopyable base class, as, for example, described by @Dennis.
    2. Create a stereotype, you can, for example, name it <<non-copyable>>.

      a) Set the stereotype property CPP_CG::Class::AdditionalBaseClasses to NonCopyable (the name of the base class created above).

      b) Make the stereotype applicable to classes.

    3. Finally, add the <<non-copyable>> stereotype to all classes that shall be non copyable.