Sinelabore Homepage

Packages#

Role in SysML v2#

A package is a kind of namespace that is used solely as a container for other elements to organize the model. In addition, a package has the capability to filter imported elements based on certain conditions.

Mapping to C++#

Packages are mapped to C++ namespaces.

Presently all model elements must reside in a single model file. Imports and all related features (filtering …) are ignored by the parser. It is required to put all model content into a namespace.

Example#

SysML v2 source code:


private import ScalarValues::*;

package Test { 
  // all model content is here
}

C++ source code:


namespace Test{
} // end of namespace Test