Class PortConverter<FirstType, SecondType>
Generic port converter implementation to override.
Inherited Members
Namespace: Mechatronics.SystemGraph
Syntax
public class PortConverter<FirstType, SecondType> : IPortTypeConverter
Type Parameters
| Name | Description |
|---|---|
| FirstType | Source Type |
| SecondType | Target Type |
Constructors
PortConverter()
Default init.
Declaration
public PortConverter()
Fields
firstVar
Where the source port is connected to in the converter.
Declaration
[Field("firstVar", PortDirection.Left, FieldExtra.Read | FieldExtra.Write)]
[SerializeField]
public PortType<FirstType> firstVar
Field Value
| Type | Description |
|---|---|
| PortType<FirstType> |
reentrant
The reentrant state
Declaration
public bool reentrant
Field Value
| Type | Description |
|---|---|
| Boolean |
secondVar
Where the target port is connected to in the converter.
Declaration
[Field("secondVar", PortDirection.Left, FieldExtra.Read | FieldExtra.Write)]
[SerializeField]
public PortType<SecondType> secondVar
Field Value
| Type | Description |
|---|---|
| PortType<SecondType> |
Methods
ConvertFirstToSecond()
Implement to convert from source to target.
Declaration
public virtual void ConvertFirstToSecond()
ConvertSecondToFirst()
Implement to convert from target to source.
Declaration
public virtual void ConvertSecondToFirst()
IsCompatible()
Whether the two types are convertible.
Declaration
public override bool IsCompatible()
Returns
| Type | Description |
|---|---|
| Boolean | True if convertible. |
Overrides
RebindPorts(IPortTypeConverter.DriverSide)
Called when the converter is used by the linker. Any initialization can go here, the fields are properly set.
Declaration
public override void RebindPorts(IPortTypeConverter.DriverSide pDriverSide)
Parameters
| Type | Name | Description |
|---|---|---|
| IPortTypeConverter.DriverSide | pDriverSide | Describes which side of the converter has priority if any. |