Difference between revisions of "XCSG:TypeAlias"

From AtlasWiki
Jump to: navigation, search
m (TheodoreMurdock moved page AliasType to TypeAlias)
Line 1: Line 1:
 
A TypeAlias introduces a synonym for an existing type analogous to the use of typedef in C and C++.
 
A TypeAlias introduces a synonym for an existing type analogous to the use of typedef in C and C++.
  
A TypeAlias does not introduce a new type, but provides a synonym (alias) for a given type, the [[AliasedType]] .  This type may be an existing type, or an instantiation of a type with template parameters.
+
A TypeAlias in XCSG is not considered a [[Type]], but provides a synonym (alias) for a given type, the [[AliasedType]].  This type may be an existing type, or an instantiation of a type with template parameters.
  
A TypeAlias may appear anywhere the referenced type may appear.
+
A TypeAlias is never the [[TypeOf]] a [[Variable]] or [[DataFlow (Node)|DataFlow]] node, instead the [[TypeOf]] edge points directly to the [[Type]], while an additional [[DefinedAs]] edge points to the TypeAlias used to declare the Variable's type.
  
The semantics of the model are unchanged if all occurrences of a TypeAlias are replaced by occurrences of the referenced type.
+
A TypeAlias defined using another TypeAlias points its [[AliasedType]] edge to that TypeAlias, rather than directly to the [[Type]] it is an alias of.
  
 
== Specification ==
 
== Specification ==
 
{{Node
 
{{Node
| extends = Type
+
| extends = Node
 
| description = An alias for an existing type.
 
| description = An alias for an existing type.
 
}}
 
}}
 
== Language mappings ==
 
AliasType maps to typedef in C and C++.
 

Revision as of 11:39, 13 May 2014

A TypeAlias introduces a synonym for an existing type analogous to the use of typedef in C and C++.

A TypeAlias in XCSG is not considered a Type, but provides a synonym (alias) for a given type, the AliasedType. This type may be an existing type, or an instantiation of a type with template parameters.

A TypeAlias is never the TypeOf a Variable or DataFlow node, instead the TypeOf edge points directly to the Type, while an additional DefinedAs edge points to the TypeAlias used to declare the Variable's type.

A TypeAlias defined using another TypeAlias points its AliasedType edge to that TypeAlias, rather than directly to the Type it is an alias of.

Specification

Metaclass TypeAlias
Extends Node
Description An alias for an existing type.
Direct Subkinds C:Enum
All Superkinds Node, ModelElement
Specified In Edges
In Edge Predecessor Multiplicity Description
AliasedType TypeAlias Connects a TypeAlias to the Type or TypeAlias it was declared to duplicate.
DefinedAs Variable Connects a Variable or DataFlow node which received its Type via a TypeAlias (such as a C/C++ typedef) to that TypeAlias.
DataFlow (Node)
Specified Out Edges
Out Edge Successor Multiplicity Description
AliasedType Type 0..1 Connects a TypeAlias to the Type or TypeAlias it was declared to duplicate.
TypeAlias 0..1
Known Possible In Edges

Inherited From In Edge Predecessor Multiplicity Description
Node Contains Node 1 Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge.
Known Possible Out Edges

Inherited From Out Edge Successor Multiplicity Description
Node Contains Node Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge.