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)); } }
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); } }