Beispiel #1
0
        public MessageElementPodMultiDimArray PackPodMultiDimArray <T>(PodMultiDimArray s) where T : struct
        {
            string typename;

            if (CompareNamespace(ServiceDefinitionUtil.FindStructRRType(s.pod_array.GetType().GetElementType()), out typename))
            {
                return(((PodStub <T>)FindPodStub(typename)).PackPodMultiDimArray(s));
            }
            else
            {
                return(node.PackPodMultiDimArray <T>(s, context));
            }
        }
        public virtual MessageElementPodMultiDimArray PackPodMultiDimArray(PodMultiDimArray s3)
        {
            if (s3 == null)
            {
                return(null);
            }
            var l = new List <MessageElement>();

            MessageElementUtil.AddMessageElement(l, "dims", s3.Dims);
            var s4 = PackPodArray((T[])s3.pod_array);

            MessageElementUtil.AddMessageElement(l, "array", s4);
            return(new MessageElementPodMultiDimArray(TypeName, l));
        }
Beispiel #3
0
        public virtual void AssignSubArray(uint[] memorypos, PodMultiDimArray buffer, uint[] bufferpos, uint[] count)
        {
            PodMultiDimArray mema = this;
            PodMultiDimArray memb = buffer;

            MultiDimArray_CalculateCopyIndicesIter iter = MultiDimArray_CalculateCopyIndicesIter.BeginIter(mema.Dims, memorypos, memb.Dims, bufferpos, count);

            uint indexa;
            uint indexb;
            uint len;

            while (iter.Next(out indexa, out indexb, out len))
            {
                Array.Copy(memb.pod_array, (long)indexb, mema.pod_array, (long)indexa, (long)len);
            }
        }
        public virtual PodMultiDimArray UnpackPodMultiDimArray(MessageElementPodMultiDimArray s3)
        {
            if (s3.Type != TypeName)
            {
                throw new DataTypeException("pod type mismatch");
            }
            var o = new PodMultiDimArray();
            var marrayElements = s3.Elements;

            {
                o.Dims = (MessageElementUtil.FindElementAndCast <uint[]>(marrayElements, "dims"));
                var s2 = (MessageElementUtil.FindElementAndCast <MessageElementPodArray>(marrayElements, "array"));
                o.pod_array = UnpackPodArray(s2);
            }
            return(o);
        }