C++/CLI Conventions

Return to Introduction  Previous page  Next page

The following conventions are used for modeling C++/CLI extensions to C++.  In order to set Enterprise Architect to generate managed C++/CLI you must modify the C++ version in the C++ Options.

Stereotypes

Stereotype

Applies to

Description

reference

Class

Corresponds to the ref class or ref struct keyword.

value

Class

Corresponds to the value class or value struct keyword.

property

Operation, Attribute

This is a property possibly containing both read and write code.

event

Operation

Defines an event to provide access to the event handler for this class.

Tagged Values

Tag

Applies to

Description

managedType

Class with stereotype reference, value or enumeration; Interface

Corresponds to either the class or struct keyword.

generic

Operation

Defines the generic parameters for this Operation.

genericConstraints

Templated Class or Interface, Operation with tag generic

Defines the constraints on the generic parameters for this Operation.

attribute_name

Operation with stereotype property or event

The name of the variable behind this property or event.

initonly

Attribute

Corresponds to the initonly keyword.

literal

Attribute

Corresponds to the literal keyword.

Other Conventions

·The typedef and anonymous tags are not used
·The property get/property set stereotypes are not used
·The Pure property of an operation corresponds to the keyword abstract.

See Also