docs.unity.cn
    Show / Hide Table of Contents

    Class PortConverter<FirstType, SecondType>

    Generic port converter implementation to override.

    Inheritance
    Object
    IPortType
    IPortTypeConverter
    PortConverter<FirstType, SecondType>
    PortConverterDoubleFloat
    PortConverterDoubleInt
    PortConverterDoubleUint
    PortConverterFloatDouble
    PortConverterFloatInt
    PortConverterFloatUint
    PortConverterIntDouble
    PortConverterIntFloat
    PortConverterIntUint
    PortConverterToString<T>
    PortConverterUintDouble
    PortConverterUintFloat
    PortConverterUintInt
    Inherited Members
    IPortTypeConverter.driverSide
    IPortTypeConverter.rawFirstField
    IPortTypeConverter.rawSecondField
    IPortType.globalId
    IPortType.uniqueId
    IPortType.synchronizeAfterLinking
    IPortType.Clock
    IPortType.ChangeEvent
    IPortType.Batching
    IPortType.SignalBatch
    IPortType.Connected
    IPortType.Driver
    IPortType.SetConnected(Boolean)
    IPortType.SetSynchronizeAfterLinking(Boolean)
    IPortType.CreateFieldBox()
    IPortType.TrySetValue(Object)
    IPortType.TryGetValue()
    IPortType.Synchronize()
    IPortType.Propagate(Double)
    IPortType.SetOnChangeClockRisingEdge(Boolean)
    IPortType.SetAsDriver(Object)
    IPortType.BeginBatch()
    IPortType.EndBatch()
    IPortType.TypeNiceName(Type)
    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
    IPortTypeConverter.IsCompatible()

    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.

    Overrides
    IPortTypeConverter.RebindPorts(IPortTypeConverter.DriverSide)
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use