| SPP Tool Chain | ![]() |
| 2.4 Datatypes |
Datatype models are attached to dataflow components, or more precisely to their input and output ports and parameters to define the interface of those components. When the components are hooked up using dataflow connections, their interfaces can be checked to ensure that only compatible objects are connected. The datatype models are also used to generate the corresponding definitions in the target programming/configuration language ensuring consistency. The following elements are used in modeling various data types. All datatypes supported by the C programming language can be modeled.
The modeling elements that are used in representing a dataflow graph are described below. The description consists of a name of the modeling element, the stereotype of the modeling element which indicates the concrete syntactic realization of the element in GME (i.e. Folder, Model, Atom, Connection, Set, etc.), an explanation of the role and purpose of modeling element, and a description of the attributes of the modeling element. For additional details on understanding the concrete syntactic constructs of GME, please refer to the GME documentation.
1. DataTypes
|
Stereotype: |
Folder |
|
Description: |
DataTypes is the folder to create DataTypeSyetem. In this folder a user can model the primitive, compound or logical data types and aggregate them in the model DatatypeSystem. |
|
Stereotype: |
Model |
|
Description: |
DataTypeSystem is the model to aggregate the primitive, compound or logical data types. |
3.
GenTypeBase
|
Stereotype: |
FCO |
|
Description: |
GenTypeBase is an abstract base class for TypeRefBase and TypeBase. |
4. TypeBase
|
Stereotype: |
Model |
|
Description: |
TypeBase is an abstract base class that help capture the common characteristics of PrimitiveType, CompoundType and Logical. All datatypes supported by the C programming language can be modeled. |
5.
PrimitiveType
|
Stereotype: |
Model |
|
Description: |
PrimitiveType is an abstract base class that help capture the common characteristics of simple data types, Int and Float. |
|
Stereotype: |
Model |
|||||||||||||||
|
Description: |
Int represents the integer data type. |
|||||||||||||||
|
Attribute: |
|
|
Stereotype: |
Model |
||||||||||||
|
Description: |
Float represents the float data type. |
||||||||||||
|
Attribute: |
|
8.
CompundType
|
Stereotype: |
Model |
|
Description: |
CompoundType is an abstract base class that help capture the common characteristics of composite data types, Union, Struct and LibraryType. Composite types can contain simple types and other composite types by using the references to them. |
|
Stereotype: |
Model |
||||||
|
Description: |
Union model provides the facility for the user to define Union data type by using the reference to simple or compound datatypes. |
||||||
|
Attribute: |
|
|
Stereotype: |
Model |
||||||
|
Description: |
Struct model provides the facility for the user to define Struct data type by using the reference to simple or compound datatypes. |
||||||
|
Attribute: |
|
|
Stereotype: |
Model |
|||||||||
|
Description: |
Library model provides the facility for the user to define Library data type by using the reference to simple or compound datatypes, and also specify the include file in attribute "IncludeFile" field. |
|||||||||
|
Attribute: |
|
|
Stereotype: |
Model |
||||||||||||
|
Description: |
Float represents the float data type. |
||||||||||||
|
Attribute: |
|
13.
TypeRefBase
|
Stereotype: |
FCO |
|
Description: |
TypeRefBase is an abstract base class that help capture the common characteristics of references to different datatypes, PITypeRef, PFTypeRef, LTypeRef and CTypeRef. These references refer to data type model defined elsewhere in the application model and they are used in CompoundType for creating the user-defined composite datatype. |
14. PITypeRef
|
Stereotype: |
Reference |
|||||||||
|
Description: |
PITypeRef is a reference to Int data type |
|||||||||
|
Attribute: |
|
16.
PFTypeRef
|
Stereotype: |
Reference |
|
Description: |
PFTypeRef is a reference to Float data type. |
17.
LTypeRef
|
Stereotype: |
Reference |
|
Description: |
PFTypeRef is a reference to Library data type. |
18.
CTypeRef
|
Stereotype: |
Reference |
|
Description: |
PFTypeRef is a reference to CompoundType data type. |
The metamodel of the above elements in modeling the data types is shown as below:
Datatype models are associated with input/output ports and parameters of components to define their interface. The following elements are used in defining the typing of ports and parameters:
19. Primitive
Described in 2.1. Dataflow
|
Stereotype: |
FCO |
|
Description: |
TVDTR is an abstract base class for TypeVar and DataTypeRef. |
20. TypeVar
Described in 2.2. Computational Cores
21. DataTypeRef
Described in 2.2. Computational
Cores
22. TypeRelation
|
Stereotype: |
Connection |
||||||
| Description: |
|
||||||
|
Attribute: |
|
23.
PortParam
|
Stereotype: |
Atom |
|
Description: |
PortParam is an abstract base class for Port and Parameter. |
24. Port
Described in 2.1. Dataflow
25. Parameter
Described in 2.5. Parameters
|
Stereotype: |
Connection |
| Description: |
TypeConn is an association between dataflow Ports and the TypeRefBase abstract base class. Both this connection and the TypeRefBase itself can be inserted into dataflow components, primitive, compound or alternative. TypeConn assigns the referred to type to the given port. Notice that the components are often programmed such that they can support different data-types, and the specialization is done during build time. This type of type polymorphism is represented in SPML with the use of explicit type variables (TypeVar). A type polymorphic port is connected to a TypeVar with the TypeConn. OCL constraints have been included in the meta-model to check that connected ports have compatible datatypes. |
The metamodel of the above elements in defining the datatype of components ports and parameters is shown as below:
Next Up: 2.5 Parameters