Skip to content

Commit f993f14

Browse files
POCO interface defines operation (#209)
1 parent 58bca49 commit f993f14

403 files changed

Lines changed: 5886 additions & 1724 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/AnnotatingElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public AnnotatingElement()
182182
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
183183
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
184184
[Implements(implementation: "IElement.OwnedRelationship")]
185-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
185+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
186186

187187
/// <summary>Backing field for IElement.OwnedRelationship</summary>
188188
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ public Association()
429429
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
430430
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
431431
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
432-
public IReadOnlyCollection<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
432+
public IReadOnlyList<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
433433

434434
/// <summary>Backing field for IRelationship.OwnedRelatedElement</summary>
435435
ContainerList<IRelationship, IElement> IContainedRelationship.OwnedRelatedElement { get; set; }
@@ -440,7 +440,7 @@ public Association()
440440
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
441441
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
442442
[Implements(implementation: "IElement.OwnedRelationship")]
443-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
443+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
444444

445445
/// <summary>Backing field for IElement.OwnedRelationship</summary>
446446
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Dependency.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public Dependency()
177177
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
178178
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
179179
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
180-
public IReadOnlyCollection<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
180+
public IReadOnlyList<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
181181

182182
/// <summary>Backing field for IRelationship.OwnedRelatedElement</summary>
183183
ContainerList<IRelationship, IElement> IContainedRelationship.OwnedRelatedElement { get; set; }
@@ -188,7 +188,7 @@ public Dependency()
188188
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
189189
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
190190
[Implements(implementation: "IElement.OwnedRelationship")]
191-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
191+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
192192

193193
/// <summary>Backing field for IElement.OwnedRelationship</summary>
194194
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/EnumerationDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ bool Systems.DefinitionAndUsage.IDefinition.IsVariation
615615
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
616616
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
617617
[Implements(implementation: "IElement.OwnedRelationship")]
618-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
618+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
619619

620620
/// <summary>Backing field for IElement.OwnedRelationship</summary>
621621
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Feature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ public Feature()
590590
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
591591
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
592592
[Implements(implementation: "IElement.OwnedRelationship")]
593-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
593+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
594594

595595
/// <summary>Backing field for IElement.OwnedRelationship</summary>
596596
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FeatureTyping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ IType Core.Types.ISpecialization.General
185185
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
186186
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
187187
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
188-
public IReadOnlyCollection<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
188+
public IReadOnlyList<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
189189

190190
/// <summary>Backing field for IRelationship.OwnedRelatedElement</summary>
191191
ContainerList<IRelationship, IElement> IContainedRelationship.OwnedRelatedElement { get; set; }
@@ -196,7 +196,7 @@ IType Core.Types.ISpecialization.General
196196
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
197197
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
198198
[Implements(implementation: "IElement.OwnedRelationship")]
199-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
199+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
200200

201201
/// <summary>Backing field for IElement.OwnedRelationship</summary>
202202
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ public Flow()
650650
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
651651
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
652652
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
653-
public IReadOnlyCollection<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
653+
public IReadOnlyList<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
654654

655655
/// <summary>Backing field for IRelationship.OwnedRelatedElement</summary>
656656
ContainerList<IRelationship, IElement> IContainedRelationship.OwnedRelatedElement { get; set; }
@@ -661,7 +661,7 @@ public Flow()
661661
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
662662
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
663663
[Implements(implementation: "IElement.OwnedRelationship")]
664-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
664+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
665665

666666
/// <summary>Backing field for IElement.OwnedRelationship</summary>
667667
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ string Root.Namespaces.IMembership.MemberShortName
312312
[Property(xmiId: "_18_5_3_12e503d9_1533160674986_59873_43302", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
313313
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")]
314314
[Implements(implementation: "IRelationship.OwnedRelatedElement")]
315-
public IReadOnlyCollection<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
315+
public IReadOnlyList<IElement> OwnedRelatedElement => ((IContainedRelationship)this).OwnedRelatedElement;
316316

317317
/// <summary>Backing field for IRelationship.OwnedRelatedElement</summary>
318318
ContainerList<IRelationship, IElement> IContainedRelationship.OwnedRelatedElement { get; set; }
@@ -323,7 +323,7 @@ string Root.Namespaces.IMembership.MemberShortName
323323
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
324324
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
325325
[Implements(implementation: "IElement.OwnedRelationship")]
326-
public IReadOnlyCollection<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
326+
public IReadOnlyList<IRelationship> OwnedRelationship => ((IContainedElement)this).OwnedRelationship;
327327

328328
/// <summary>Backing field for IElement.OwnedRelationship</summary>
329329
ContainerList<IElement, IRelationship> IContainedElement.OwnedRelationship { get; set; }

SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/IElement.cs

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public partial interface IElement
124124
/// </summary>
125125
[Property(xmiId: "_18_5_3_12e503d9_1543092026091_217766_16748", aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
126126
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_585972_43176")]
127-
IReadOnlyCollection<IRelationship> OwnedRelationship { get; }
127+
IReadOnlyList<IRelationship> OwnedRelationship { get; }
128128

129129
/// <summary>
130130
/// The owner of this Element, derived as the owningRelatedElement of the owningRelationship of this
@@ -184,6 +184,55 @@ public partial interface IElement
184184
[SubsettedProperty(propertyName: "_18_5_3_12e503d9_1543092869879_112608_17278")]
185185
List<ITextualRepresentation> textualRepresentation { get; }
186186

187+
/// <summary>
188+
/// Return name, if that is not null, otherwise the shortName, if that is not null, otherwise null. If
189+
/// the returned value is non-null, it is returned as-is if it has the form of a basic name, or,
190+
/// otherwise, represented as a restricted name according to the lexical structure of the KerML textual
191+
/// notation (i.e., surrounded by single quote characters and with special characters escaped).
192+
/// </summary>
193+
/// <returns>
194+
/// The expected string
195+
/// </returns>
196+
string EscapedName() => this.ComputeEscapedNameOperation();
197+
198+
/// <summary>
199+
/// Return an effective shortName for this Element. By default this is the same as its
200+
/// declaredShortName.
201+
/// </summary>
202+
/// <returns>
203+
/// The expected string
204+
/// </returns>
205+
string EffectiveShortName() => this.ComputeEffectiveShortNameOperation();
206+
207+
/// <summary>
208+
/// Return an effective name for this Element. By default this is the same as its declaredName.
209+
/// </summary>
210+
/// <returns>
211+
/// The expected string
212+
/// </returns>
213+
string EffectiveName() => this.ComputeEffectiveNameOperation();
214+
215+
/// <summary>
216+
/// By default, return the library Namespace of the owningRelationship of this Element, if it has one.
217+
/// </summary>
218+
/// <returns>
219+
/// The expected INamespace
220+
/// </returns>
221+
INamespace LibraryNamespace() => this.ComputeLibraryNamespaceOperation();
222+
223+
/// <summary>
224+
/// Return a unique description of the location of this Element in the containment structure rooted in a
225+
/// root Namespace. If the Element has a non-null qualifiedName, then return that. Otherwise, if it has
226+
/// an owningRelationship, then return the string constructed by appending to the path of it's
227+
/// owningRelationship the character / followed by the string representation of its position in the list
228+
/// of ownedRelatedElements of the owningRelationship (indexed starting at 1). Otherwise, return the
229+
/// empty string. (Note that this operation is overridden for Relationships
230+
/// to use owningRelatedElement when appropriate.)
231+
/// </summary>
232+
/// <returns>
233+
/// The expected string
234+
/// </returns>
235+
string Path() => this.ComputePathOperation();
187236
}
188237
}
189238

0 commit comments

Comments
 (0)