Example #1
0
        public virtual void AssignSubArray(uint[] memorypos, NamedMultiDimArray buffer, uint[] bufferpos, uint[] count)
        {
            NamedMultiDimArray mema = this;
            NamedMultiDimArray memb = buffer;

            MultiDimArray_CalculateCopyIndicesIter iter = RobotRaconteurNET.MultiDimArray_CalculateCopyIndicesBeginIter(
                new vectoruint32(mema.Dims), new vectoruint32(memorypos), new vectoruint32(memb.Dims),
                new vectoruint32(bufferpos), new vectoruint32(count));

            uint indexa;
            uint indexb;
            uint len;

            while (iter.Next(out indexa, out indexb, out len))
            {
                Array.Copy(memb.namedarray_array, (long)indexb, mema.namedarray_array, (long)indexa, (long)len);
            }
        }
Example #2
0
 public override void Write(vector_uint64_t memorypos, MessageElementNestedElementList buffer,
                            vector_uint64_t bufferpos, vector_uint64_t count)
 {
     try
     {
         using (buffer) using (memorypos) using (bufferpos) using (count)
                     {
                         NamedMultiDimArray buffer2 = RobotRaconteurNode.s.UnpackNamedMultiDimArray <T>(buffer);
                         mem.Write(memorypos.ToArray(), buffer2, bufferpos.ToArray(), count.ToArray());
                     }
     }
     catch (Exception e)
     {
         using (MessageEntry merr = new MessageEntry())
         {
             RobotRaconteurExceptionUtil.ExceptionToMessageEntry(e, merr);
             RRDirectorExceptionHelper.SetError(merr, e.ToString());
         }
     }
 }
Example #3
0
 public override MessageElementNestedElementList Read(vector_uint64_t memorypos, vector_uint64_t bufferpos, vector_uint64_t count)
 {
     try
     {
         using (memorypos)
             using (bufferpos)
                 using (count)
                 {
                     NamedMultiDimArray buffer3 = new NamedMultiDimArray(count.Select(x => (uint)x).ToArray(), new T[count.Aggregate(1, (x, y) => (int)x * (int)y)]);
                     mem.Read(memorypos.ToArray(), buffer3, new ulong[count.Count], count.ToArray());
                     return(RobotRaconteurNode.s.PackNamedMultiDimArray <T>(buffer3));
                 }
     }
     catch (Exception e)
     {
         using (MessageEntry merr = new MessageEntry())
         {
             RobotRaconteurExceptionUtil.ExceptionToMessageEntry(e, merr);
             RRDirectorExceptionHelper.SetError(merr, e.ToString());
         }
         return(null);
     }
 }
Example #4
0
 public virtual void Read(ulong[] memorypos, NamedMultiDimArray buffer, ulong[] bufferpos, ulong[] count)
 {
     multimemory.RetrieveSubArray(memorypos.Select(x => (uint)x).ToArray(), buffer, bufferpos.Select(x => (uint)x).ToArray(), count.Select(x => (uint)x).ToArray());
 }
Example #5
0
 public virtual void Attach(NamedMultiDimArray memory)
 {
     this.multimemory = memory;
 }
Example #6
0
 public NamedMultiDimArrayMemory(NamedMultiDimArray memory)
 {
     multimemory = memory;
 }
Example #7
0
 public override void Attach(NamedMultiDimArray memory)
 {
     throw new InvalidOperationException("Invalid for memory client");
 }
Example #8
0
 public bufferdirector(NamedMultiDimArray buffer)
 {
     this.buffer = buffer;
 }
Example #9
0
 public virtual void Write(ulong[] memorypos, NamedMultiDimArray buffer, ulong[] bufferpos, ulong[] count)
 {
     multimemory.AssignSubArray(memorypos.Select(x => (uint)x).ToArray(), buffer, bufferpos.Select(x => (uint)x).ToArray(), count.Select(x => (uint)x).ToArray());
 }
Example #10
0
 public static MessageElement PackNamedMultiDimArray <T>(string name, NamedMultiDimArray val)
     where T : struct
 {
     return(NewMessageElementDispose(name, RobotRaconteurNode.s.PackNamedMultiDimArray <T>(val)));
 }