/// <summary> /// Initializes a new instance of the <see cref="ElementCreatorReadOnlyList"/> class. /// </summary> /// <param name="delegates">The user type delegates.</param> /// <param name="elementType">The element type.</param> /// <param name="arrayStartAddress">The array start address.</param> public ElementCreatorReadOnlyList(IUserTypeDelegates <T> delegates, CodeType elementType, ulong arrayStartAddress) { this.delegates = delegates; this.elementType = elementType; this.arrayStartAddress = arrayStartAddress; elementTypeSize = elementType.Size; }
/// <summary> /// Selects the type based on the specified variables code type. /// </summary> /// <param name="variable">The variable.</param> /// <returns>New instance of user type that knows how to read variable data.</returns> public T SelectType(Variable variable) { CodeType codeType = variable.GetCodeType(); IUserTypeDelegates delegates = GetUserTypeDelegates(codeType); return((T)delegates?.SymbolicConstructor(variable)); }
/// <summary> /// Initializes a new instance of the <see cref="BufferedElementCreatorReadOnlyList"/> class. /// </summary> /// <param name="delegates">The user type delegates.</param> /// <param name="elementType">The element type.</param> /// <param name="buffer">The memory buffer.</param> /// <param name="bufferAddress">The memory buffer address.</param> /// <param name="arrayStartAddress">The array start address.</param> public BufferedElementCreatorReadOnlyList(IUserTypeDelegates <T> delegates, CodeType elementType, MemoryBuffer buffer, ulong bufferAddress, ulong arrayStartAddress) { this.delegates = delegates; this.elementType = elementType; this.arrayStartAddress = arrayStartAddress; this.buffer = buffer; this.bufferAddress = bufferAddress; elementTypeSize = elementType.Size; }