using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IACommService4CSharp
{
    public class ArrayBase_t<T> : DataValue_t where T : ComplexBase_t, new()
    {
        public ArrayBase_t(uint[] dimensions = null) : base(DType.Complex, dimensions)
        {
        }
        //Internal use
        public ArrayBase_t(IDataValue4CSharp value) : base(value)
        {
        }
        ~ArrayBase_t()
        {
        }
        public T GetElement(uint index)
        {
            T value = new T();
            var status = Internal.GetElement(index, value.Internal);
            if (status != ErrorCode.Good)
                return null;

            return value;
        }
        public T GetElement(uint[] indexes)
        {
            T value = new T();
            var status = Internal.GetElement(indexes, value.Internal);
            if (status != ErrorCode.Good)
                return null;

            return value;
        }
    }
}
