Esempio n. 1
0
 public override MessageElementNestedElementList PackWriteRequest(vector_uint64_t bufferpos,
                                                                  vector_uint64_t count)
 {
     using (bufferpos) using (count)
         {
             PodMultiDimArray o = new PodMultiDimArray(count.Select(x => (uint)x).ToArray(),
                                                       new T[count.Aggregate(1, (x, y) => (int)x * (int)y)]);
             buffer.RetrieveSubArray(bufferpos.Select(x => (uint)x).ToArray(), o, new uint[buffer.Dims.Length],
                                     count.Select(x => (uint)x).ToArray());
             return(RobotRaconteurNode.s.PackPodMultiDimArray <T>(o));
         }
 }
Esempio n. 2
0
 public override void UnpackReadResult(MessageElementNestedElementList res, vector_uint64_t bufferpos, vector_uint64_t count)
 {
     using (res)
         using (bufferpos)
             using (count)
             {
                 PodMultiDimArray res1 = RobotRaconteurNode.s.UnpackPodMultiDimArrayDispose <T>(res);
                 buffer.AssignSubArray(bufferpos.Select(x => (uint)x).ToArray(), res1, new uint[buffer.Dims.Length], count.Select(x => (uint)x).ToArray());
             }
 }
Esempio n. 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)
                 {
                     PodMultiDimArray buffer3 = new PodMultiDimArray(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.PackPodMultiDimArray <T>(buffer3));
                 }
     }
     catch (Exception e)
     {
         using (MessageEntry merr = new MessageEntry())
         {
             RobotRaconteurExceptionUtil.ExceptionToMessageEntry(e, merr);
             RRDirectorExceptionHelper.SetError(merr, e.ToString());
         }
         return(null);
     }
 }