| Data member (attribute, association, or object) |
A global variable |
A member in the singleton struct |
| Function nameYou can configure the name pattern for functions
(for files, objects, and other elements) using the <lang>_CG::Operation::PublicName and <lang>_CG::Operation::PrivateName properties. |
The function name pattern is <Function>. |
The name pattern for public functions is <Singleton>_<function>. The pattern for private functions is <Function>.
|
| Function signature |
The me argument is generated when required
to comply with the signature of framework callback functions (for
reactive behavior). |
The same. |
| Initialization |
Variables and associations are initialized directly in the
definition. For example: int x=5;
Objects are initialized in a generated Init function.
|
Done in the initialize function. |
| Type name |
The name pattern for types (regardless of visibility) is <Type>. |
The name pattern for public types is <Singleton>_type. The name pattern for private functions is <Type>.
The name pattern can be configured using the <lang>_CG::Type::PublicName and PrivateName properties.
|
| Visibility |
Public members are declared as extern in the
specification (.h) file and defined in the implementation
(.c) file. For example:
extern int volume;
Private
members are declared and defined in the implementation file as static.
For example:
static int
volume;
|
Member visibility is ignored; the visibility is a result of
the visibility of the struct. For
example:
struct Ob_t {
int volume; };
|
| Auto-generated |
| Initialization and cleanup |
Only algorithmic initialization is done in the initialization
method (creating parts; initializing links, behavior, and animation). The initialization and cleanup methods are created
only when needed.
The name of the initialization
function is <file>_Init;
the cleanup function is <file>_Cleanup.
|
Any initialization is done in the Init method. Init and Cleanup methods
are generated by default.
|
| Framework data members |
Rational Rhapsody generates
a designated struct that holds only the framework
members, and a single instance of the struct named <file>.
The struct name is <file>_t. For example:
struct Motor_t
{ RiCReactive ric_reactive; }
|
Framework members are generated as part of the object struct declaration. |
| Call framework operations |
Framework operations on the file are called using the file. For example:
CGEN(Motor,
ev());
|
Framework operations on the singleton are called passing the
singleton instance. For example:
CGEN(Motor,ev());
|
| Statechart data members |
Statechart data members are generated as attributes of the
generated structure. For example:
struct
F_t { ... enum F_Enum { F_RiCNonState=0,
F_ready=1} F_EnumVar; int rootState_subState;
int rootState_active; };
|
Statechart data members are generated as part of the struct. |
| Statechart function names |
Public statechart functions are generated using the prefix <file>_. For example:
myFile_sIN()
|
Use the same naming convention as any other operation. |