@@ -782,6 +782,24 @@ def _accepted_subtypes(self) -> set[ar_enum.IdentifiableSubTypes]:
782
782
ar_enum .IdentifiableSubTypes .VARIABLE_DATA_PROTOTYPE ,
783
783
}
784
784
785
+
786
+ class PortInterfaceRef (BaseRef ):
787
+ """
788
+ References to PORT-INTERFACE--SUBTYPES-ENUM
789
+
790
+ Only a fraction of elements seen in the XML Schema are
791
+ actually supported.
792
+ """
793
+
794
+ def _accepted_subtypes (self ) -> set [ar_enum .IdentifiableSubTypes ]:
795
+ """Acceptable values for dest"""
796
+ return {ar_enum .IdentifiableSubTypes .CLIENT_SERVER_INTERFACE ,
797
+ ar_enum .IdentifiableSubTypes .MODE_SWITCH_INTERFACE ,
798
+ ar_enum .IdentifiableSubTypes .NV_DATA_INTERFACE ,
799
+ ar_enum .IdentifiableSubTypes .PARAMETER_INTERFACE ,
800
+ ar_enum .IdentifiableSubTypes .SENDER_RECEIVER_INTERFACE ,
801
+ }
802
+
785
803
# --- Documentation Elements
786
804
787
805
@@ -4429,16 +4447,127 @@ class PortPrototype(Identifiable):
4429
4447
# .VARIATION-POINT not supported
4430
4448
4431
4449
4432
- class AbstractProvidedPortPrototype (PortPrototype ):
4450
+ class ProvidePortPrototype (PortPrototype ):
4433
4451
"""
4434
- Group AR:ABSTRACT-PROVIDED-PORT-PROTOTYPE
4452
+ Complex type AR:P-PORT-PROTOTYPE
4453
+ Tag variants: 'P-PORT-PROTOTYPE'
4454
+
4455
+ Includes AR:ABSTRACT-PROVIDED-PORT-PROTOTYPE
4435
4456
"""
4436
4457
4437
- def __init__ (self , name : str ,
4458
+ def __init__ (self ,
4459
+ name : str ,
4460
+ port_interface_ref : PortInterfaceRef | None = None ,
4438
4461
com_spec : ProvidePortComSpec | list [ProvidePortComSpec ] | None = None ,
4439
4462
** kwargs ) -> None :
4440
4463
super ().__init__ (name , ** kwargs )
4441
- # .FIELD-SENDER-COM-SPEC not supported
4464
+ self .com_spec : list [ProvidePortComSpec ] = [] # .PROVIDED-COM-SPECS
4465
+ self .port_interface_ref : PortInterfaceRef | None = None # .PROVIDED-INTERFACE-TREF
4466
+ self ._assign_optional_strict ("port_interface_ref" , port_interface_ref , PortInterfaceRef )
4467
+ if com_spec is not None :
4468
+ if isinstance (com_spec , ProvidePortComSpec ):
4469
+ self .append_com_spec (com_spec )
4470
+ elif isinstance (com_spec , (list , tuple )):
4471
+ for com_spec_elem in com_spec :
4472
+ self .append_com_spec (com_spec_elem )
4473
+ else :
4474
+ raise TypeError ("com_spec must be of a type derived from ProvidePortComSpec" )
4475
+
4476
+ def append_com_spec (self , com_spec : ProvidePortComSpec ) -> None :
4477
+ """
4478
+ Adds comspec to internal list of com-specs
4479
+ """
4480
+ if isinstance (com_spec , ProvidePortComSpec ):
4481
+ self .com_spec .append (com_spec )
4482
+ else :
4483
+ raise TypeError ("com_spec must be of a type derived from ProvidePortComSpec" )
4484
+
4485
+
4486
+ class RequirePortPrototype (PortPrototype ):
4487
+ """
4488
+ Complex type AR:R-PORT-PROTOTYPE
4489
+ Tag variants: 'R-PORT-PROTOTYPE'
4490
+
4491
+ Includes AR:ABSTRACT-REQUIRED-PORT-PROTOTYPE
4492
+ """
4493
+
4494
+ def __init__ (self ,
4495
+ name : str ,
4496
+ port_interface_ref : PortInterfaceRef | None = None ,
4497
+ com_spec : RequirePortComSpec | list [RequirePortComSpec ] | None = None ,
4498
+ allow_unconnected : bool | None = None ,
4499
+ ** kwargs ) -> None :
4500
+ super ().__init__ (name , ** kwargs )
4501
+ self .com_spec : list [RequirePortComSpec ] = [] # .REQUIRED-COM-SPECS
4502
+ self .allow_unconnected : bool | None = None # .MAY-BE-UNCONNECTED
4503
+ self .port_interface_ref : PortInterfaceRef | None = None # .REQUIRED-INTERFACE-TREF
4504
+ self ._assign_optional_strict ("port_interface_ref" , port_interface_ref , PortInterfaceRef )
4505
+ self ._assign_optional ("allow_unconnected" , allow_unconnected , bool )
4506
+ if com_spec is not None :
4507
+ if isinstance (com_spec , RequirePortComSpec ):
4508
+ self .append_com_spec (com_spec )
4509
+ elif isinstance (com_spec , (list , tuple )):
4510
+ for com_spec_elem in com_spec :
4511
+ self .append_com_spec (com_spec_elem )
4512
+ else :
4513
+ raise TypeError ("com_spec must be of a type derived from RequirePortComSpec" )
4514
+
4515
+ def append_com_spec (self , com_spec : RequirePortComSpec ) -> None :
4516
+ """
4517
+ Adds comspec to internal list of com-specs
4518
+ """
4519
+ if isinstance (com_spec , RequirePortComSpec ):
4520
+ self .com_spec .append (com_spec )
4521
+ else :
4522
+ raise TypeError ("com_spec must be of type RequirePortComSpec" )
4523
+
4524
+
4525
+ class PRPortPrototype (PortPrototype ):
4526
+ """
4527
+ Complex type AR:PR-PORT-PROTOTYPE
4528
+ Tag variants: 'PR-PORT-PROTOTYPE'
4529
+
4530
+ Includes AR:ABSTRACT-PROVIDED-PORT-PROTOTYPE and AR:ABSTRACT-REQUIRED-PORT-PROTOTYPE
4531
+ """
4532
+
4533
+ def __init__ (self ,
4534
+ name : str ,
4535
+ port_interface_ref : PortInterfaceRef | None = None ,
4536
+ provided_com_spec : ProvidePortComSpec | list [ProvidePortComSpec ] | None = None ,
4537
+ required_com_spec : RequirePortComSpec | list [RequirePortComSpec ] | None = None ,
4538
+ ** kwargs ) -> None :
4539
+ super ().__init__ (name , ** kwargs )
4540
+ self .port_interface_ref : PortInterfaceRef | None = None
4541
+ self .provided_com_spec : list [ProvidePortComSpec ] = []
4542
+ self .required_com_spec : list [RequirePortComSpec ] = []
4543
+ self ._assign_optional_strict ("port_interface_ref" , port_interface_ref , PortInterfaceRef )
4544
+ if provided_com_spec is not None :
4545
+ if isinstance (provided_com_spec , ProvidePortComSpec ):
4546
+ self .append_com_spec (provided_com_spec )
4547
+ elif isinstance (required_com_spec , (list , tuple )):
4548
+ for com_spec_elem in provided_com_spec :
4549
+ self .append_com_spec (com_spec_elem )
4550
+ else :
4551
+ raise TypeError ("provided_com_spec must be of a type derived from ProvidePortComSpec" )
4552
+ if required_com_spec is not None :
4553
+ if isinstance (required_com_spec , RequirePortComSpec ):
4554
+ self .append_com_spec (required_com_spec )
4555
+ elif isinstance (required_com_spec , (list , tuple )):
4556
+ for com_spec_elem in required_com_spec :
4557
+ self .append_com_spec (com_spec_elem )
4558
+ else :
4559
+ raise TypeError ("required_com_spec must be of a type derived from RequirePortComSpec" )
4560
+
4561
+ def append_com_spec (self , com_spec : ProvidePortComSpec | RequirePortComSpec ) -> None :
4562
+ """
4563
+ Append com-spec to internal list(s) of com-specs
4564
+ """
4565
+ if isinstance (com_spec , ProvidePortComSpec ):
4566
+ self .provided_com_spec .append (com_spec )
4567
+ elif isinstance (com_spec , RequirePortComSpec ):
4568
+ self .required_com_spec .append (com_spec )
4569
+ else :
4570
+ raise TypeError ("com_spec must be of either type ProvidePortComSpec, RequirePortComSpec" )
4442
4571
4443
4572
4444
4573
class SoftwareComponentType (ARElement ):
0 commit comments