Zurück zu Willert.de

Flow Ports In C

Rhapsody Model or Codegeneration topics

Flow Ports In C

Postby DjCisco » January 28th, 2014, 11:04 am

Hi Community,

I am trying to build a Model in C and I want to use flow ports to transmit a value from one "Class" to another.

In C++ if Class A is connected to Class B via flow ports , one can automatically update the values linked to the flow ports in Class A & B.

To do this in C++ one must change the value of the linked attribute by using the corresponding "set" method.

I wish to perform the same thing in C. Rhasody in C however does not create the "set" methods for defined attributes. Does anyone know how flow ports are used in C.

any help is greatly appreciated.
Posts: 5
Joined: June 28th, 2011, 9:07 pm

Re: Flow Ports In C

Postby Skywalker » February 18th, 2014, 12:43 pm

Basically Rhapsody in C uses the very same mechanism and the same rules.

There are two default settings in Rhapsody in C, which differ from C++, and which cause the problem you see:
C_CG::Attribute::AccessorGenerate is cleared
C_CG::Attribute::MutatorGenerate is set to Never

You have to enable Accessor and Mutator generation for each attribute, that shall be connected to a flow port of the same name and same data type. If more or all attributes need Accessor/Mutator then it may be easier to set these properties on class, package, configuration, component or project level... or via a custom Stereotype (setting both properties) assigned to one of these levels.

There may be more interesting properties in context of flow ports, like:

And of course the rule for creating a change event by manually using get$attribute:c for the event name.

Hope this helps!
May the force be with you ...
Posts: 74
Joined: October 31st, 2007, 5:09 pm
Location: Milkyway, classic 9-planet solar system

Return to Modelling with Rhapsody

Who is online

Users browsing this forum: No registered users and 9 guests