/// <summary> /// Constructs a descriptor instance. /// </summary> /// <param name="dir">data-flow direction of the port</param> /// <param name="usage">usage hint</param> /// <param name="domain">optional argument for future use</param> /// <param name="elementType">type descriptor of exchanged data</param> public PortBuilder(EFlowDirection dir, EPortUsage usage, string domain, TypeDescriptor elementType) { _dir = dir; _usage = usage; _domain = domain; _elementType = elementType; }
internal SignalArgumentDescriptor(TypeDescriptor argumentType, EFlowDirection direction, TypeDescriptor elementType, EFlowDirection access) : base(argumentType, direction) { _elementType = elementType; _access = access; }
public ISignalOrPortDescriptor GetSignal(EBinderFlags flags, EPortUsage portUsage, string name, string domainID, object initialValue) { if (portUsage == EPortUsage.Clock) { return(FindClock(domainID).Descriptor); } else if (portUsage == EPortUsage.State) { throw new NotSupportedException("State signal is not supported by default auto-binder"); } else { if (flags.HasFlag(EBinderFlags.ExistingSignal)) { var result = _host.Descriptor.FindSignal(name); if (result != null) { return(null); } } if (flags.HasFlag(EBinderFlags.CreateNewPort)) { EFlowDirection dir = EFlowDirection.In; if (flags.HasFlag(EBinderFlags.In)) { dir = EFlowDirection.In; } if (flags.HasFlag(EBinderFlags.Out)) { dir = EFlowDirection.Out; } if (flags.HasFlag(EBinderFlags.InOut)) { dir = EFlowDirection.InOut; } int id = _id++; var port = _host.Descriptor.CreatePort("agp" + id + "_" + name, dir, TypeDescriptor.GetTypeOf(initialValue)); return(port); } if (flags.HasFlag(EBinderFlags.CreateNewSignal)) { int id = _id++; var signal = _host.Descriptor.CreateSignalInstance("ags" + id + "_" + name, TypeDescriptor.GetTypeOf(initialValue)); return(signal); } return(null); } }
/// <summary> /// Creates and adds a new port. /// </summary> /// <param name="me">component descriptor to host the new port</param> /// <param name="name">name of new port</param> /// <param name="dir">data-flow direction</param> /// <param name="dataType">type descriptor of exchanged data</param> /// <returns>the descriptor of the newly created port</returns> public static PortBuilder CreatePort(this IComponentDescriptor me, string name, EFlowDirection dir, TypeDescriptor dataType) { return(CreatePort(me, name, dir, EPortUsage.Default, dataType)); }
/// <summary> /// Creates and adds a new port. /// </summary> /// <param name="me">component descriptor to host the new port</param> /// <param name="name">name of new port</param> /// <param name="dir">data-flow direction</param> /// <param name="usage">usage hint</param> /// <param name="dataType">type descriptor of exchanged data</param> /// <returns>the descriptor of the newly created port</returns> public static PortBuilder CreatePort(this IComponentDescriptor me, string name, EFlowDirection dir, EPortUsage usage, TypeDescriptor dataType) { Contract.Requires <ArgumentNullException>(me != null); Contract.Requires <ArgumentNullException>(name != null); Contract.Requires <ArgumentNullException>(dataType != null); PortBuilder result = new PortBuilder(dir, usage, null, dataType); me.AddChild(result, name); return(result); }
internal ArgumentDescriptor(TypeDescriptor argumentType, EFlowDirection direction) { _argumentType = argumentType; _direction = direction; }
public ISignalArgumentDescriptor AddNewSignalArgument(string name, int index, TypeDescriptor elementType, EFlowDirection access) { var arg = new SignalArgumentDescriptor(typeof(SignalBase), EFlowDirection.In, elementType, access); arg.Nest(this, new IndexSpec(index)); return(arg); }
public IArgumentDescriptor AddNewArgument(string name, int index, TypeDescriptor argumentType, EFlowDirection direction) { var arg = new ArgumentDescriptor(argumentType, direction); arg.Nest(this, new IndexSpec(index)); return(arg); }
public ScrollBox(Element owner, EFlowDirection block_Flow_Direction, EFlowDirection inline_Base_Direction) : this(block_Flow_Direction, inline_Base_Direction) { Owner = owner; }
public ScrollBox(IViewport owner, EFlowDirection block_Flow_Direction, EFlowDirection inline_Base_Direction) : this(block_Flow_Direction, inline_Base_Direction) { View = owner; }
private ScrollBox(EFlowDirection block_Flow_Direction, EFlowDirection inline_Base_Direction) { Block = block_Flow_Direction; Inline = inline_Base_Direction; }
/// <summary> /// Creates and adds a new port. /// </summary> /// <param name="me">component descriptor to host the new port</param> /// <param name="name">name of new port</param> /// <param name="dir">data-flow direction</param> /// <param name="dataType">type descriptor of exchanged data</param> /// <returns>the descriptor of the newly created port</returns> public static PortBuilder CreatePort(this IComponentDescriptor me, string name, EFlowDirection dir, TypeDescriptor dataType) { return CreatePort(me, name, dir, EPortUsage.Default, dataType); }
/// <summary> /// Creates and adds a new port. /// </summary> /// <param name="me">component descriptor to host the new port</param> /// <param name="name">name of new port</param> /// <param name="dir">data-flow direction</param> /// <param name="usage">usage hint</param> /// <param name="dataType">type descriptor of exchanged data</param> /// <returns>the descriptor of the newly created port</returns> public static PortBuilder CreatePort(this IComponentDescriptor me, string name, EFlowDirection dir, EPortUsage usage, TypeDescriptor dataType) { Contract.Requires<ArgumentNullException>(me != null); Contract.Requires<ArgumentNullException>(name != null); Contract.Requires<ArgumentNullException>(dataType != null); PortBuilder result = new PortBuilder(dir, usage, null, dataType); me.AddChild(result, name); return result; }
/// <summary> /// Constructs a new instance. /// </summary> /// <param name="direction">data direction</param> public MapToPort(EFlowDirection direction) { Direction = direction; }
private string PortDirectionToString(EFlowDirection dir) { switch (dir) { case EFlowDirection.In: return "in"; case EFlowDirection.Out: return "out"; case EFlowDirection.InOut: return "inout"; default: throw new NotImplementedException(); } }