Robot Raconteur Core C++ Library
MemoryMember.h
Go to the documentation of this file.
1 
24 #pragma once
25 
27 #include "RobotRaconteur/Message.h"
29 #include "RobotRaconteur/Client.h"
30 #include "RobotRaconteur/Service.h"
31 #include <stdexcept>
32 
33 namespace RobotRaconteur
34 {
35 
36 namespace detail
37 {
38 template <typename Y, typename U>
39 static std::vector<Y> ConvertVectorType(const std::vector<U>& in)
40 {
41  std::vector<Y> out(in.size());
42  for (size_t i = 0; i < in.size(); i++)
43  out[i] = boost::numeric_cast<Y>(in[i]);
44  return out;
45 }
46 
47 template <typename Y, typename U>
48 static RR_INTRUSIVE_PTR<RRArray<Y> > ConvertRRArrayType(const RR_INTRUSIVE_PTR<RRArray<U> >& in)
49 {
50  RR_INTRUSIVE_PTR<RRArray<Y> > out = AllocateRRArray<Y>(in->size());
51  for (size_t i = 0; i < in->size(); i++)
52  (*out)[i] = boost::numeric_cast<Y>((*in)[i]);
53  return out;
54 }
55 
56 ROBOTRACONTEUR_CORE_API void CalculateMatrixBlocks(uint32_t element_size, std::vector<uint64_t> count,
57  uint64_t max_elems, uint32_t& split_dim, uint64_t& split_dim_block,
58  uint64_t& split_elem_count, uint32_t& splits_count,
59  uint32_t& split_remainder, std::vector<uint64_t>& block_count,
60  std::vector<uint64_t>& block_count_edge);
61 } // namespace detail
62 
69 class ROBOTRACONTEUR_CORE_API ArrayMemoryBase
70 {
71  public:
72  virtual uint64_t Length() = 0;
73  virtual DataTypes ElementTypeID() = 0;
74  virtual ~ArrayMemoryBase() {}
75 };
76 
103 template <typename T>
104 class ArrayMemory : public virtual ArrayMemoryBase
105 {
106  private:
107  RR_INTRUSIVE_PTR<RRArray<T> > memory;
108  boost::mutex memory_lock;
109 
110  public:
119 
129  ArrayMemory(const RR_INTRUSIVE_PTR<RRArray<T> >& memory) { this->memory = memory; }
130 
136  virtual void Attach(const RR_INTRUSIVE_PTR<RRArray<T> >& memory)
137  {
138  boost::mutex::scoped_lock lock(memory_lock);
139  this->memory = memory;
140  }
141 
150  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
151  {
152  boost::mutex::scoped_lock lock(memory_lock);
153  return memory->size();
154  }
155 
170  virtual void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRArray<T> >& buffer, uint64_t bufferpos, uint64_t count)
171  {
172  boost::mutex::scoped_lock lock(memory_lock);
173  if (memorypos + count > memory->size())
174  throw OutOfRangeException("Index out of range");
175  if (bufferpos + count > buffer->size())
176  throw OutOfRangeException("Index out of range");
177 
178  memcpy(buffer->data() + bufferpos, memory->data() + memorypos, boost::numeric_cast<size_t>(count * sizeof(T)));
179  }
180 
195  virtual void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRArray<T> >& buffer, uint64_t bufferpos,
196  uint64_t count)
197  {
198  boost::mutex::scoped_lock lock(memory_lock);
199  if (memorypos + count > memory->size())
200  throw OutOfRangeException("Index out of range");
201  if (bufferpos + count > buffer->size())
202  throw OutOfRangeException("Index out of range");
203  memcpy(memory->data() + memorypos, buffer->data() + bufferpos, boost::numeric_cast<size_t>(count * sizeof(T)));
204  }
205 
206  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return RRPrimUtil<T>::GetTypeID(); }
207 };
208 
215 class ROBOTRACONTEUR_CORE_API MultiDimArrayMemoryBase
216 {
217  public:
218  virtual std::vector<uint64_t> Dimensions() = 0;
219  virtual uint64_t DimCount() = 0;
220  virtual DataTypes ElementTypeID() = 0;
221  virtual ~MultiDimArrayMemoryBase() {}
222 };
223 
250 template <typename T>
252 {
253  private:
254  RR_INTRUSIVE_PTR<RRMultiDimArray<T> > multimemory;
255  boost::mutex memory_lock;
256 
257  public:
266 
276  MultiDimArrayMemory(const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& multimemory) { this->multimemory = multimemory; }
277 
278  RR_OVIRTUAL ~MultiDimArrayMemory() RR_OVERRIDE {}
279 
285  virtual void Attach(const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& multimemory)
286  {
287  boost::mutex::scoped_lock lock(memory_lock);
288  this->multimemory = multimemory;
289  }
290 
301  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE
302  {
303  boost::mutex::scoped_lock lock(memory_lock);
304  RR_INTRUSIVE_PTR<RRArray<uint32_t> > dims = multimemory->Dims;
305  std::vector<uint64_t> s(dims->size());
306  for (size_t i = 0; i < s.size(); i++)
307  {
308  s[i] = (*dims)[i];
309  }
310 
311  return s;
312  }
313 
322  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
323  {
324  boost::mutex::scoped_lock lock(memory_lock);
325  return multimemory->Dims->size();
326  }
327 
342  virtual void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
343  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
344  {
345  boost::mutex::scoped_lock lock(memory_lock);
346  multimemory->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
347  detail::ConvertVectorType<uint32_t>(bufferpos),
348  detail::ConvertVectorType<uint32_t>(count));
349  }
350 
366  virtual void Write(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
367  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
368  {
369  boost::mutex::scoped_lock lock(memory_lock);
370  multimemory->AssignSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
371  detail::ConvertVectorType<uint32_t>(bufferpos),
372  detail::ConvertVectorType<uint32_t>(count));
373  }
374 
375  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return RRPrimUtil<T>::GetTypeID(); }
376 };
377 
378 class ROBOTRACONTEUR_CORE_API ArrayMemoryServiceSkelBase : private boost::noncopyable
379 {
380 
381  private:
382  std::string m_MemberName;
383  RR_WEAK_PTR<ServiceSkel> skel;
384  RR_WEAK_PTR<RobotRaconteurNode> node;
385  MemberDefinition_Direction direction;
386  DataTypes element_type;
387  size_t element_size;
388  std::string service_path;
389 
390  public:
391  RR_SHARED_PTR<RobotRaconteurNode> GetNode();
392  std::string GetMemberName() const;
393  ArrayMemoryServiceSkelBase(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
394  DataTypes element_type, size_t element_size, MemberDefinition_Direction direction);
395  virtual ~ArrayMemoryServiceSkelBase();
396  virtual RR_INTRUSIVE_PTR<MessageEntry> CallMemoryFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m,
397  const RR_SHARED_PTR<Endpoint>& e,
398  const RR_SHARED_PTR<ArrayMemoryBase>& mem);
399 
400  protected:
401  virtual RR_INTRUSIVE_PTR<MessageElementData> DoRead(uint64_t memorypos, uint64_t bufferpos, uint64_t count,
402  const RR_SHARED_PTR<ArrayMemoryBase>& mem) = 0;
403  virtual void DoWrite(uint64_t memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer, uint64_t bufferpos,
404  uint64_t count, const RR_SHARED_PTR<ArrayMemoryBase>& mem) = 0;
405 };
406 
407 template <typename T>
408 class ArrayMemoryServiceSkel : public ArrayMemoryServiceSkelBase
409 {
410  public:
411  ArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
412  MemberDefinition_Direction direction)
413  : ArrayMemoryServiceSkelBase(membername, skel, RRPrimUtil<T>::GetTypeID(), sizeof(T), direction)
414  {}
415 
416  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(uint64_t memorypos, uint64_t bufferpos, uint64_t count,
417  const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
418  {
419  RR_UNUSED(bufferpos);
420  RR_SHARED_PTR<ArrayMemory<T> > mem1 = rr_cast<ArrayMemory<T> >(mem);
421  RR_INTRUSIVE_PTR<RRArray<T> > buf1 = AllocateRRArray<T>(boost::numeric_cast<size_t>(count));
422  mem1->Read(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
423  return buf1;
424  }
425 
426  RR_OVIRTUAL void DoWrite(uint64_t memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer, uint64_t bufferpos,
427  uint64_t count, const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
428  {
429  RR_UNUSED(bufferpos);
430  RR_SHARED_PTR<ArrayMemory<T> > mem1 = rr_cast<ArrayMemory<T> >(mem);
431  RR_INTRUSIVE_PTR<RRArray<T> > buf1 = rr_cast<RRArray<T> >(buffer);
432  mem1->Write(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
433  }
434 };
435 
436 class ROBOTRACONTEUR_CORE_API MultiDimArrayMemoryServiceSkelBase : private boost::noncopyable
437 {
438 
439  private:
440  std::string m_MemberName;
441  RR_WEAK_PTR<ServiceSkel> skel;
442  RR_WEAK_PTR<RobotRaconteurNode> node;
443  MemberDefinition_Direction direction;
444  DataTypes element_type;
445  size_t element_size;
446  std::string service_path;
447 
448  public:
449  RR_SHARED_PTR<RobotRaconteurNode> GetNode();
450  std::string GetMemberName() const;
451  MultiDimArrayMemoryServiceSkelBase(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
452  DataTypes element_type, size_t element_size,
453  MemberDefinition_Direction direction);
454  virtual ~MultiDimArrayMemoryServiceSkelBase();
455  virtual RR_INTRUSIVE_PTR<MessageEntry> CallMemoryFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m,
456  const RR_SHARED_PTR<Endpoint>& e,
457  const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem);
458  virtual RR_INTRUSIVE_PTR<MessageElementData> DoRead(const std::vector<uint64_t>& memorypos,
459  const std::vector<uint64_t>& bufferpos,
460  const std::vector<uint64_t>& count, uint32_t elem_count,
461  const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) = 0;
462  virtual void DoWrite(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer,
463  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
464  uint32_t elem_count, const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) = 0;
465 };
466 
467 template <typename T>
468 class MultiDimArrayMemoryServiceSkel : public MultiDimArrayMemoryServiceSkelBase
469 {
470  public:
471  MultiDimArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
472  MemberDefinition_Direction direction)
473  : MultiDimArrayMemoryServiceSkelBase(membername, skel, RRPrimUtil<T>::GetTypeID(), sizeof(T), direction)
474  {}
475 
476  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(
477  const std::vector<uint64_t>& memorypos, const std::vector<uint64_t>& bufferpos,
478  const std::vector<uint64_t>& count, uint32_t elemcount,
479  const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
480  {
481  RR_SHARED_PTR<MultiDimArrayMemory<T> > mem1 = rr_cast<MultiDimArrayMemory<T> >(mem);
482 
483  RR_INTRUSIVE_PTR<RRArray<T> > real = AllocateRRArray<T>(boost::numeric_cast<size_t>(elemcount));
484  RR_INTRUSIVE_PTR<RRMultiDimArray<T> > data;
485 
486  data = AllocateRRMultiDimArray<T>(VectorToRRArray<uint32_t>(count), real);
487 
488  mem1->Read(memorypos, data, bufferpos, count);
489  return GetNode()->PackMultiDimArray(data);
490  }
491  RR_OVIRTUAL void DoWrite(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer,
492  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
493  uint32_t elemcount, const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
494  {
495  RR_UNUSED(elemcount);
496  RR_SHARED_PTR<MultiDimArrayMemory<T> > mem1 = rr_cast<MultiDimArrayMemory<T> >(mem);
497 
498  RR_INTRUSIVE_PTR<RRMultiDimArray<T> > data =
499  GetNode()->template UnpackMultiDimArray<T>(rr_cast<MessageElementNestedElementList>(buffer));
500  mem1->Write(memorypos, data, bufferpos, count);
501  }
502 };
503 
504 class ROBOTRACONTEUR_CORE_API ArrayMemoryClientBase : private boost::noncopyable
505 {
506  protected:
507  std::string m_MemberName;
508  RR_WEAK_PTR<ServiceStub> stub;
509  RR_WEAK_PTR<RobotRaconteurNode> node;
510  MemberDefinition_Direction direction;
511  DataTypes element_type;
512  size_t element_size;
513  std::string service_path;
514  uint32_t endpoint;
515 
516  public:
517  const std::string GetMemberName() const;
518  RR_SHARED_PTR<RobotRaconteurNode> GetNode();
519  ArrayMemoryClientBase(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub, DataTypes element_type,
520  size_t element_size, MemberDefinition_Direction direction);
521  virtual ~ArrayMemoryClientBase();
522 
523  RR_SHARED_PTR<ServiceStub> GetStub();
524  virtual uint64_t Length();
526 
527  protected:
528  bool max_size_read;
529  uint32_t remote_max_size;
530  boost::mutex max_size_lock;
531  uint32_t GetMaxTransferSize();
532  virtual void ReadBase(uint64_t memorypos, void* buffer, uint64_t bufferpos, uint64_t count);
533  virtual void WriteBase(uint64_t memorypos, const void* buffer, uint64_t bufferpos, uint64_t count);
534 
535  public:
536  void Shutdown();
537 
538  protected:
539  virtual void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer, uint64_t offset,
540  uint64_t count) = 0;
541  virtual RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer, uint64_t offset,
542  uint64_t count) = 0;
543  virtual size_t GetBufferLength(const void* buffer) = 0;
544 };
545 
546 template <typename T>
547 class ArrayMemoryClient : public virtual ArrayMemoryClientBase, public virtual ArrayMemory<T>
548 {
549  public:
550  ArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub,
551  MemberDefinition_Direction direction)
552  : ArrayMemoryClientBase(membername, stub, RRPrimUtil<T>::GetTypeID(), sizeof(T), direction)
553  {}
554 
555  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRArray<T> >& memory) RR_OVERRIDE
556  {
557  RR_UNUSED(memory);
558  throw InvalidOperationException("Invalid for client");
559  }
560 
561  RR_OVIRTUAL void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRArray<T> >& buffer, uint64_t bufferpos,
562  uint64_t count) RR_OVERRIDE
563  {
564  if (!buffer)
565  throw NullValueException("Buffer must not be null");
566  ReadBase(memorypos, &buffer, bufferpos, count);
567  }
568 
569  RR_OVIRTUAL void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRArray<T> >& buffer, uint64_t bufferpos,
570  uint64_t count) RR_OVERRIDE
571  {
572  if (!buffer)
573  throw NullValueException("Buffer must not be null");
574  WriteBase(memorypos, &buffer, bufferpos, count);
575  }
576 
577  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE { return ArrayMemoryClientBase::Length(); }
578 
579  protected:
580  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer, uint64_t bufferpos,
581  uint64_t count) RR_OVERRIDE
582  {
583  RR_INTRUSIVE_PTR<RRArray<T> > data = rr_cast<RRArray<T> >(res);
584  RR_INTRUSIVE_PTR<RRArray<T> >& buffer1 = *static_cast<RR_INTRUSIVE_PTR<RRArray<T> >*>(buffer);
585  memcpy(buffer1->data() + bufferpos, data->data(), boost::numeric_cast<size_t>(count * sizeof(T)));
586  }
587 
588  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer, uint64_t bufferpos,
589  uint64_t count) RR_OVERRIDE
590  {
591  const RR_INTRUSIVE_PTR<RRArray<T> >& buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRArray<T> >*>(buffer);
592  if (bufferpos == 0 && buffer1->size() == boost::numeric_cast<size_t>(count))
593  {
594  return buffer1;
595  }
596  else if ((buffer1->size() - boost::numeric_cast<size_t>(bufferpos)) >= boost::numeric_cast<size_t>(count))
597  {
598  RR_INTRUSIVE_PTR<RRArray<T> > data = AllocateRRArray<T>(boost::numeric_cast<size_t>(count));
599  memcpy(data->data(), buffer1->data() + bufferpos, boost::numeric_cast<size_t>(count * sizeof(T)));
600  return data;
601  }
602  else
603  throw OutOfRangeException("");
604  }
605 
606  RR_OVIRTUAL size_t GetBufferLength(const void* buffer) RR_OVERRIDE
607  {
608  const RR_INTRUSIVE_PTR<RRArray<T> >& buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRArray<T> >*>(buffer);
609  return buffer1->size();
610  }
611 };
612 
613 class ROBOTRACONTEUR_CORE_API MultiDimArrayMemoryClientBase : private boost::noncopyable
614 {
615  protected:
616  std::string m_MemberName;
617  RR_WEAK_PTR<ServiceStub> stub;
618  RR_WEAK_PTR<RobotRaconteurNode> node;
619  MemberDefinition_Direction direction;
620  DataTypes element_type;
621  size_t element_size;
622  std::string service_path;
623  uint32_t endpoint;
624 
625  public:
626  RR_SHARED_PTR<RobotRaconteurNode> GetNode();
627  const std::string GetMemberName() const;
628 
629  MultiDimArrayMemoryClientBase(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub,
630  DataTypes element_type, size_t element_size, MemberDefinition_Direction direction);
631  virtual ~MultiDimArrayMemoryClientBase();
632  RR_SHARED_PTR<ServiceStub> GetStub();
634  virtual std::vector<uint64_t> Dimensions();
635  virtual uint64_t DimCount();
636 
637  protected:
638  bool max_size_read;
639  uint32_t remote_max_size;
640  boost::mutex max_size_lock;
641 
642  uint32_t GetMaxTransferSize();
643  virtual void ReadBase(const std::vector<uint64_t>& memorypos, void* buffer, const std::vector<uint64_t>& bufferpos,
644  const std::vector<uint64_t>& count);
645  virtual void WriteBase(const std::vector<uint64_t>& memorypos, const void* buffer,
646  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count);
647 
648  public:
649  void Shutdown();
650 
651  protected:
652  virtual void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer,
653  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
654  uint64_t elemcount) = 0;
655  virtual RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer,
656  const std::vector<uint64_t>& bufferpos,
657  const std::vector<uint64_t>& count,
658  uint64_t elemcount) = 0;
659 };
660 
661 template <typename T>
662 class MultiDimArrayMemoryClient : public virtual MultiDimArrayMemory<T>, public virtual MultiDimArrayMemoryClientBase
663 {
664  public:
665  MultiDimArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub,
666  MemberDefinition_Direction direction)
667  : MultiDimArrayMemoryClientBase(membername, stub, RRPrimUtil<T>::GetTypeID(), sizeof(T), direction)
668  {}
669 
670  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& memory) RR_OVERRIDE
671  {
672  RR_UNUSED(memory);
673  throw InvalidOperationException("Not valid for client");
674  }
675 
676  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::Dimensions(); }
677 
678  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::DimCount(); }
679 
680  RR_OVIRTUAL void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
681  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
682  {
683  if (!buffer)
684  throw NullValueException("Buffer must not be null");
685  ReadBase(memorypos, &buffer, bufferpos, count);
686  }
687 
688  RR_OVIRTUAL void Write(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer,
689  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
690  {
691  if (!buffer)
692  throw NullValueException("Buffer must not be null");
693  WriteBase(memorypos, &buffer, bufferpos, count);
694  }
695 
696  protected:
697  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer,
698  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
699  uint64_t elemcount) RR_OVERRIDE
700  {
701  RR_UNUSED(elemcount);
702  RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer1 = *static_cast<RR_INTRUSIVE_PTR<RRMultiDimArray<T> >*>(buffer);
703  RR_INTRUSIVE_PTR<RRMultiDimArray<T> > data =
704  GetNode()->template UnpackMultiDimArray<T>(rr_cast<MessageElementNestedElementList>(res));
705 
706  RR_SHARED_PTR<MultiDimArrayMemory<T> > data2 = RR_MAKE_SHARED<MultiDimArrayMemory<T> >(data);
707  data2->Read(std::vector<uint64_t>(count.size()), buffer1, bufferpos, count);
708  }
709  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer,
710  const std::vector<uint64_t>& bufferpos,
711  const std::vector<uint64_t>& count,
712  uint64_t elemcount) RR_OVERRIDE
713  {
714  const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >& buffer1 =
715  *static_cast<const RR_INTRUSIVE_PTR<RRMultiDimArray<T> >*>(buffer);
716 
717  bool equ = true;
718  for (size_t i = 0; i < count.size(); i++)
719  {
720  if (bufferpos[i] != 0 || static_cast<uint64_t>((*buffer1->Dims)[i]) != count[i])
721  {
722  equ = false;
723  break;
724  }
725  }
726 
727  if (equ)
728  {
729  return GetNode()->PackMultiDimArray(buffer1);
730  }
731  else
732  {
733  RR_INTRUSIVE_PTR<RRMultiDimArray<T> > data;
734 
735  data = AllocateRRMultiDimArray<T>(VectorToRRArray<uint32_t>(count),
736  AllocateRRArray<T>(boost::numeric_cast<size_t>(elemcount)));
737 
738  buffer1->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(bufferpos), data,
739  std::vector<uint32_t>(count.size()), detail::ConvertVectorType<uint32_t>(count));
740  return GetNode()->PackMultiDimArray(data);
741  }
742  }
743 };
744 
745 // pod
746 
772 template <typename T>
773 class PodArrayMemory : public virtual ArrayMemoryBase
774 {
775  private:
776  RR_INTRUSIVE_PTR<RRPodArray<T> > memory;
777  boost::mutex memory_lock;
778 
779  public:
788 
798  PodArrayMemory(const RR_INTRUSIVE_PTR<RRPodArray<T> >& memory) { this->memory = memory; }
799 
805  virtual void Attach(const RR_INTRUSIVE_PTR<RRPodArray<T> >& memory)
806  {
807  boost::mutex::scoped_lock lock(memory_lock);
808  this->memory = memory;
809  }
810 
812  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
813  {
814  boost::mutex::scoped_lock lock(memory_lock);
815  return memory->size();
816  }
817 
819  virtual void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer, uint64_t bufferpos, uint64_t count)
820  {
821  boost::mutex::scoped_lock lock(memory_lock);
822  if (memorypos + count > memory->size())
823  throw OutOfRangeException("Index out of range");
824  if (bufferpos + count > buffer->size())
825  throw OutOfRangeException("Index out of range");
826 
827  for (size_t i = 0; i < count; i++)
828  {
829  buffer->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + bufferpos)) =
830  memory->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + memorypos));
831  }
832  }
833 
835  virtual void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer, uint64_t bufferpos,
836  uint64_t count)
837  {
838  boost::mutex::scoped_lock lock(memory_lock);
839  if (memorypos + count > memory->size())
840  throw OutOfRangeException("Index out of range");
841  if (bufferpos + count > buffer->size())
842  throw OutOfRangeException("Index out of range");
843  for (size_t i = 0; i < count; i++)
844  {
845  memory->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + memorypos)) =
846  buffer->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + bufferpos));
847  }
848  }
849 
850  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return DataTypes_pod_t; }
851 };
852 
853 template <typename T>
854 class PodArrayMemoryServiceSkel : public ArrayMemoryServiceSkelBase
855 {
856  public:
857  PodArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel, size_t element_size,
858  MemberDefinition_Direction direction)
859  : ArrayMemoryServiceSkelBase(membername, skel, DataTypes_pod_t, element_size, direction)
860  {}
861 
862  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(uint64_t memorypos, uint64_t bufferpos, uint64_t count,
863  const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
864  {
865  RR_UNUSED(bufferpos);
866  RR_SHARED_PTR<PodArrayMemory<T> > mem1 = rr_cast<PodArrayMemory<T> >(mem);
867  RR_INTRUSIVE_PTR<RRPodArray<T> > buf1 = AllocateEmptyRRPodArray<T>(boost::numeric_cast<size_t>(count));
868  mem1->Read(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
869  return PodStub_PackPodArray(buf1);
870  }
871 
872  RR_OVIRTUAL void DoWrite(uint64_t memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer, uint64_t bufferpos,
873  uint64_t count, const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
874  {
875  RR_UNUSED(bufferpos);
876  RR_SHARED_PTR<PodArrayMemory<T> > mem1 = rr_cast<PodArrayMemory<T> >(mem);
877  RR_INTRUSIVE_PTR<RRPodArray<T> > buf1 =
878  PodStub_UnpackPodArray<T>(rr_cast<MessageElementNestedElementList>(buffer));
879  mem1->Write(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
880  }
881 };
882 
883 template <typename T>
884 class PodArrayMemoryClient : public virtual ArrayMemoryClientBase, public virtual PodArrayMemory<T>
885 {
886  public:
887  PodArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub, size_t element_size,
888  MemberDefinition_Direction direction)
889  : ArrayMemoryClientBase(membername, stub, RRPrimUtil<T>::GetTypeID(), element_size, direction)
890  {}
891 
892  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRPodArray<T> >& memory) RR_OVERRIDE
893  {
894  RR_UNUSED(memory);
895  throw InvalidOperationException("Invalid for client");
896  }
897 
898  RR_OVIRTUAL void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer, uint64_t bufferpos,
899  uint64_t count) RR_OVERRIDE
900  {
901  if (!buffer)
902  throw NullValueException("Buffer must not be null");
903  ReadBase(memorypos, &buffer, bufferpos, count);
904  }
905 
906  RR_OVIRTUAL void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer, uint64_t bufferpos,
907  uint64_t count) RR_OVERRIDE
908  {
909  if (!buffer)
910  throw NullValueException("Buffer must not be null");
911  WriteBase(memorypos, &buffer, bufferpos, count);
912  }
913 
914  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE { return ArrayMemoryClientBase::Length(); }
915 
916  protected:
917  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer, uint64_t bufferpos,
918  uint64_t count) RR_OVERRIDE
919  {
920  RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer1 = *static_cast<RR_INTRUSIVE_PTR<RRPodArray<T> >*>(buffer);
921  RR_INTRUSIVE_PTR<RRPodArray<T> > res1 =
922  PodStub_UnpackPodArray<T>(rr_cast<RobotRaconteur::MessageElementNestedElementList>(res));
923 
924  for (size_t i = 0; i < count; i++)
925  {
926  buffer1->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + bufferpos)) = res1->at(i);
927  }
928  }
929 
930  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer, uint64_t bufferpos,
931  uint64_t count) RR_OVERRIDE
932  {
933  RR_INTRUSIVE_PTR<RRPodArray<T> > buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRPodArray<T> >*>(buffer);
934  RR_INTRUSIVE_PTR<RRPodArray<T> > o = AllocateEmptyRRPodArray<T>(boost::numeric_cast<size_t>(count));
935 
936  for (size_t i = 0; i < count; i++)
937  {
938  o->at(i) = buffer1->at(boost::numeric_cast<typename RRPodArray<T>::size_type>(i + bufferpos));
939  }
940  return PodStub_PackPodArray(o);
941  }
942 
943  RR_OVIRTUAL size_t GetBufferLength(const void* buffer) RR_OVERRIDE
944  {
945  const RR_INTRUSIVE_PTR<RRPodArray<T> >& buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRPodArray<T> >*>(buffer);
946  return buffer1->size();
947  }
948 };
949 
975 template <typename T>
977 {
978  private:
979  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > multimemory;
980  boost::mutex memory_lock;
981 
982  public:
991 
1001  PodMultiDimArrayMemory(const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& multimemory)
1002  {
1003  this->multimemory = multimemory;
1004  }
1005 
1006  RR_OVIRTUAL ~PodMultiDimArrayMemory() RR_OVERRIDE {}
1007 
1013  virtual void Attach(const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& multimemory)
1014  {
1015  boost::mutex::scoped_lock lock(memory_lock);
1016  this->multimemory = multimemory;
1017  }
1018 
1020  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE
1021  {
1022  boost::mutex::scoped_lock lock(memory_lock);
1023  RR_INTRUSIVE_PTR<RRArray<uint32_t> > dims = multimemory->Dims;
1024  std::vector<uint64_t> s(dims->size());
1025  for (size_t i = 0; i < s.size(); i++)
1026  {
1027  s[i] = (*dims)[i];
1028  }
1029 
1030  return s;
1031  }
1032 
1034  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
1035  {
1036  boost::mutex::scoped_lock lock(memory_lock);
1037  return multimemory->Dims->size();
1038  }
1039 
1041  virtual void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
1042  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
1043  {
1044  boost::mutex::scoped_lock lock(memory_lock);
1045  multimemory->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
1046  detail::ConvertVectorType<uint32_t>(bufferpos),
1047  detail::ConvertVectorType<uint32_t>(count));
1048  }
1049 
1051  virtual void Write(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
1052  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
1053  {
1054  boost::mutex::scoped_lock lock(memory_lock);
1055  multimemory->AssignSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
1056  detail::ConvertVectorType<uint32_t>(bufferpos),
1057  detail::ConvertVectorType<uint32_t>(count));
1058  }
1059 
1060  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return DataTypes_pod_t; }
1061 };
1062 
1063 template <typename T>
1064 class PodMultiDimArrayMemoryClient : public virtual PodMultiDimArrayMemory<T>,
1065  public virtual MultiDimArrayMemoryClientBase
1066 {
1067  public:
1068  PodMultiDimArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub,
1069  size_t element_size, MemberDefinition_Direction direction)
1070  : MultiDimArrayMemoryClientBase(membername, stub, DataTypes_pod_t, element_size, direction)
1071  {}
1072 
1073  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& memory) RR_OVERRIDE
1074  {
1075  RR_UNUSED(memory);
1076  throw InvalidOperationException("Not valid for client");
1077  }
1078 
1079  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::Dimensions(); }
1080 
1081  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::DimCount(); }
1082 
1083  RR_OVIRTUAL void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
1084  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
1085  {
1086  if (!buffer)
1087  throw NullValueException("Buffer must not be null");
1088  ReadBase(memorypos, &buffer, bufferpos, count);
1089  }
1090 
1091  RR_OVIRTUAL void Write(const std::vector<uint64_t>& memorypos,
1092  const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer,
1093  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
1094  {
1095  if (!buffer)
1096  throw NullValueException("Buffer must not be null");
1097  WriteBase(memorypos, &buffer, bufferpos, count);
1098  }
1099 
1100  protected:
1101  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer,
1102  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
1103  uint64_t elemcount) RR_OVERRIDE
1104  {
1105  RR_UNUSED(elemcount);
1106  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer1 =
1107  *static_cast<RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >*>(buffer);
1108  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > data = rr_cast<RRPodMultiDimArray<T> >(
1109  GetNode()->UnpackPodMultiDimArray(rr_cast<MessageElementNestedElementList>(res)));
1110 
1111  RR_SHARED_PTR<PodMultiDimArrayMemory<T> > data2 = RR_MAKE_SHARED<PodMultiDimArrayMemory<T> >(data);
1112  data2->Read(std::vector<uint64_t>(count.size()), buffer1, bufferpos, count);
1113  }
1114  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer,
1115  const std::vector<uint64_t>& bufferpos,
1116  const std::vector<uint64_t>& count,
1117  uint64_t elemcount) RR_OVERRIDE
1118  {
1119  const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >& buffer1 =
1120  *static_cast<const RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> >*>(buffer);
1121 
1122  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > data = AllocateEmptyRRPodMultiDimArray<T>();
1123  data->Dims = VectorToRRArray<uint32_t>(count);
1124  data->PodArray = AllocateEmptyRRPodArray<T>(boost::numeric_cast<size_t>(elemcount));
1125 
1126  buffer1->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(bufferpos), data,
1127  std::vector<uint32_t>(count.size()), detail::ConvertVectorType<uint32_t>(count));
1128  return GetNode()->PackPodMultiDimArray(data);
1129  }
1130 };
1131 
1132 template <typename T>
1133 class PodMultiDimArrayMemoryServiceSkel : public MultiDimArrayMemoryServiceSkelBase
1134 {
1135  public:
1136  PodMultiDimArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
1137  size_t element_size, MemberDefinition_Direction direction)
1138  : MultiDimArrayMemoryServiceSkelBase(membername, skel, DataTypes_structure_t, element_size, direction)
1139  {}
1140 
1141  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(
1142  const std::vector<uint64_t>& memorypos, const std::vector<uint64_t>& bufferpos,
1143  const std::vector<uint64_t>& count, uint32_t elemcount,
1144  const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
1145  {
1146  RR_SHARED_PTR<PodMultiDimArrayMemory<T> > mem1 = rr_cast<PodMultiDimArrayMemory<T> >(mem);
1147 
1148  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > data = AllocateEmptyRRPodMultiDimArray<T>();
1149  data->Dims = VectorToRRArray<uint32_t>(count);
1150  data->PodArray = AllocateEmptyRRPodArray<T>(boost::numeric_cast<size_t>(elemcount));
1151 
1152  mem1->Read(memorypos, data, bufferpos, count);
1153  return GetNode()->PackPodMultiDimArray(data);
1154  }
1155  RR_OVIRTUAL void DoWrite(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer,
1156  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
1157  uint32_t elemcount, const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
1158  {
1159  RR_UNUSED(elemcount);
1160  RR_SHARED_PTR<PodMultiDimArrayMemory<T> > mem1 = rr_cast<PodMultiDimArrayMemory<T> >(mem);
1161 
1162  RR_INTRUSIVE_PTR<RRPodMultiDimArray<T> > data = rr_cast<RRPodMultiDimArray<T> >(
1163  GetNode()->UnpackPodMultiDimArray(rr_cast<MessageElementNestedElementList>(buffer)));
1164  mem1->Write(memorypos, data, bufferpos, count);
1165  }
1166 };
1167 
1168 // namedarray
1169 
1195 template <typename T>
1196 class NamedArrayMemory : public virtual ArrayMemoryBase
1197 {
1198  private:
1199  RR_INTRUSIVE_PTR<RRNamedArray<T> > memory;
1200  boost::mutex memory_lock;
1201 
1202  public:
1211 
1221  NamedArrayMemory(const RR_INTRUSIVE_PTR<RRNamedArray<T> >& memory) { this->memory = memory; }
1222 
1228  virtual void Attach(const RR_INTRUSIVE_PTR<RRNamedArray<T> >& memory)
1229  {
1230  boost::mutex::scoped_lock lock(memory_lock);
1231  this->memory = memory;
1232  }
1233 
1235  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
1236  {
1237  boost::mutex::scoped_lock lock(memory_lock);
1238  return memory->size();
1239  }
1240 
1242  virtual void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRNamedArray<T> >& buffer, uint64_t bufferpos,
1243  uint64_t count)
1244  {
1245  boost::mutex::scoped_lock lock(memory_lock);
1246  if (memorypos + count > memory->size())
1247  throw OutOfRangeException("Index out of range");
1248  if (bufferpos + count > buffer->size())
1249  throw OutOfRangeException("Index out of range");
1250 
1251  for (size_t i = 0; i < count; i++)
1252  {
1253  (*buffer)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + bufferpos)] =
1254  (*memory)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + memorypos)];
1255  }
1256  }
1257 
1259  virtual void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRNamedArray<T> >& buffer, uint64_t bufferpos,
1260  uint64_t count)
1261  {
1262  boost::mutex::scoped_lock lock(memory_lock);
1263  if (memorypos + count > memory->size())
1264  throw OutOfRangeException("Index out of range");
1265  if (bufferpos + count > buffer->size())
1266  throw OutOfRangeException("Index out of range");
1267  for (size_t i = 0; i < count; i++)
1268  {
1269  (*memory)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + memorypos)] =
1270  (*buffer)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + bufferpos)];
1271  }
1272  }
1273 
1274  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return DataTypes_pod_t; }
1275 };
1276 
1277 template <typename T>
1278 class NamedArrayMemoryServiceSkel : public ArrayMemoryServiceSkelBase
1279 {
1280  public:
1281  NamedArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
1282  size_t element_size, MemberDefinition_Direction direction)
1283  : ArrayMemoryServiceSkelBase(membername, skel, DataTypes_pod_t, element_size, direction)
1284  {}
1285 
1286  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(uint64_t memorypos, uint64_t bufferpos, uint64_t count,
1287  const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
1288  {
1289  RR_UNUSED(bufferpos);
1290  RR_SHARED_PTR<NamedArrayMemory<T> > mem1 = rr_cast<NamedArrayMemory<T> >(mem);
1291  RR_INTRUSIVE_PTR<RRNamedArray<T> > buf1 = AllocateEmptyRRNamedArray<T>(boost::numeric_cast<size_t>(count));
1292  mem1->Read(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
1293  return NamedArrayStub_PackNamedArray(buf1);
1294  }
1295 
1296  RR_OVIRTUAL void DoWrite(uint64_t memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer, uint64_t bufferpos,
1297  uint64_t count, const RR_SHARED_PTR<ArrayMemoryBase>& mem) RR_OVERRIDE
1298  {
1299  RR_UNUSED(bufferpos);
1300  RR_SHARED_PTR<NamedArrayMemory<T> > mem1 = rr_cast<NamedArrayMemory<T> >(mem);
1301  RR_INTRUSIVE_PTR<RRNamedArray<T> > buf1 =
1302  NamedArrayStub_UnpackNamedArray<T>(rr_cast<MessageElementNestedElementList>(buffer));
1303  mem1->Write(memorypos, buf1, 0, boost::numeric_cast<size_t>(count));
1304  }
1305 };
1306 
1307 template <typename T>
1308 class NamedArrayMemoryClient : public virtual ArrayMemoryClientBase, public virtual NamedArrayMemory<T>
1309 {
1310  public:
1311  NamedArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub, size_t element_size,
1312  MemberDefinition_Direction direction)
1313  : ArrayMemoryClientBase(membername, stub, RRPrimUtil<T>::GetTypeID(), element_size, direction)
1314  {}
1315 
1316  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRNamedArray<T> >& memory) RR_OVERRIDE
1317  {
1318  RR_UNUSED(memory);
1319  throw InvalidOperationException("Invalid for client");
1320  }
1321 
1322  RR_OVIRTUAL void Read(uint64_t memorypos, RR_INTRUSIVE_PTR<RRNamedArray<T> >& buffer, uint64_t bufferpos,
1323  uint64_t count) RR_OVERRIDE
1324  {
1325  if (!buffer)
1326  throw NullValueException("Buffer must not be null");
1327  ReadBase(memorypos, &buffer, bufferpos, count);
1328  }
1329 
1330  RR_OVIRTUAL void Write(uint64_t memorypos, const RR_INTRUSIVE_PTR<RRNamedArray<T> >& buffer, uint64_t bufferpos,
1331  uint64_t count) RR_OVERRIDE
1332  {
1333  if (!buffer)
1334  throw NullValueException("Buffer must not be null");
1335  WriteBase(memorypos, &buffer, bufferpos, count);
1336  }
1337 
1338  RR_OVIRTUAL uint64_t Length() RR_OVERRIDE { return ArrayMemoryClientBase::Length(); }
1339 
1340  protected:
1341  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer, uint64_t bufferpos,
1342  uint64_t count) RR_OVERRIDE
1343  {
1344  RR_INTRUSIVE_PTR<RRNamedArray<T> >& buffer1 = *static_cast<RR_INTRUSIVE_PTR<RRNamedArray<T> >*>(buffer);
1345  RR_INTRUSIVE_PTR<RRNamedArray<T> > res1 =
1346  NamedArrayStub_UnpackNamedArray<T>(rr_cast<RobotRaconteur::MessageElementNestedElementList>(res));
1347 
1348  for (size_t i = 0; i < count; i++)
1349  {
1350  (*buffer1)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + bufferpos)] = (*res1)[i];
1351  }
1352  }
1353 
1354  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer, uint64_t bufferpos,
1355  uint64_t count) RR_OVERRIDE
1356  {
1357  RR_INTRUSIVE_PTR<RRNamedArray<T> > buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRNamedArray<T> >*>(buffer);
1358  RR_INTRUSIVE_PTR<RRNamedArray<T> > o = AllocateEmptyRRNamedArray<T>(boost::numeric_cast<size_t>(count));
1359 
1360  for (size_t i = 0; i < count; i++)
1361  {
1362  (*o)[i] = (*buffer1)[boost::numeric_cast<typename RRNamedArray<T>::size_type>(i + bufferpos)];
1363  }
1364  return NamedArrayStub_PackNamedArray(o);
1365  }
1366 
1367  RR_OVIRTUAL size_t GetBufferLength(const void* buffer) RR_OVERRIDE
1368  {
1369  RR_INTRUSIVE_PTR<RRNamedArray<T> > buffer1 = *static_cast<const RR_INTRUSIVE_PTR<RRNamedArray<T> >*>(buffer);
1370  return buffer1->size();
1371  }
1372 };
1373 
1399 template <typename T>
1401 {
1402  private:
1403  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > multimemory;
1404  boost::mutex memory_lock;
1405 
1406  public:
1415 
1425  NamedMultiDimArrayMemory(const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& multimemory)
1426  {
1427  this->multimemory = multimemory;
1428  }
1429 
1430  RR_OVIRTUAL ~NamedMultiDimArrayMemory() RR_OVERRIDE {}
1431 
1437  virtual void Attach(const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& multimemory)
1438  {
1439  boost::mutex::scoped_lock lock(memory_lock);
1440  this->multimemory = multimemory;
1441  }
1442 
1444  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE
1445  {
1446  boost::mutex::scoped_lock lock(memory_lock);
1447  RR_INTRUSIVE_PTR<RRArray<uint32_t> > dims = multimemory->Dims;
1448  std::vector<uint64_t> s(dims->size());
1449  for (size_t i = 0; i < s.size(); i++)
1450  {
1451  s[i] = (*dims)[i];
1452  }
1453 
1454  return s;
1455  }
1456 
1458  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
1459  {
1460  boost::mutex::scoped_lock lock(memory_lock);
1461  return multimemory->Dims->size();
1462  }
1463 
1465  virtual void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
1466  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
1467  {
1468  boost::mutex::scoped_lock lock(memory_lock);
1469  multimemory->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
1470  detail::ConvertVectorType<uint32_t>(bufferpos),
1471  detail::ConvertVectorType<uint32_t>(count));
1472  }
1473 
1475  virtual void Write(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
1476  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count)
1477  {
1478  boost::mutex::scoped_lock lock(memory_lock);
1479  multimemory->AssignSubArray(detail::ConvertVectorType<uint32_t>(memorypos), buffer,
1480  detail::ConvertVectorType<uint32_t>(bufferpos),
1481  detail::ConvertVectorType<uint32_t>(count));
1482  }
1483 
1484  RR_OVIRTUAL DataTypes ElementTypeID() RR_OVERRIDE { return DataTypes_pod_t; }
1485 };
1486 
1487 template <typename T>
1488 class NamedMultiDimArrayMemoryClient : public virtual NamedMultiDimArrayMemory<T>,
1489  public virtual MultiDimArrayMemoryClientBase
1490 {
1491  public:
1492  NamedMultiDimArrayMemoryClient(boost::string_ref membername, const RR_SHARED_PTR<ServiceStub>& stub,
1493  size_t element_size, MemberDefinition_Direction direction)
1494  : MultiDimArrayMemoryClientBase(membername, stub, DataTypes_pod_t, element_size, direction)
1495  {}
1496 
1497  RR_OVIRTUAL void Attach(const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& memory) RR_OVERRIDE
1498  {
1499  RR_UNUSED(memory);
1500  throw InvalidOperationException("Not valid for client");
1501  }
1502 
1503  RR_OVIRTUAL std::vector<uint64_t> Dimensions() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::Dimensions(); }
1504 
1505  RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE { return MultiDimArrayMemoryClientBase::DimCount(); }
1506 
1507  RR_OVIRTUAL void Read(const std::vector<uint64_t>& memorypos, RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
1508  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
1509  {
1510  if (!buffer)
1511  throw NullValueException("Buffer must not be null");
1512  ReadBase(memorypos, &buffer, bufferpos, count);
1513  }
1514 
1515  RR_OVIRTUAL void Write(const std::vector<uint64_t>& memorypos,
1516  const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer,
1517  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count) RR_OVERRIDE
1518  {
1519  if (!buffer)
1520  throw NullValueException("Buffer must not be null");
1521  WriteBase(memorypos, &buffer, bufferpos, count);
1522  }
1523 
1524  protected:
1525  RR_OVIRTUAL void UnpackReadResult(const RR_INTRUSIVE_PTR<MessageElementData>& res, void* buffer,
1526  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
1527  uint64_t elemcount) RR_OVERRIDE
1528  {
1529  RR_UNUSED(elemcount);
1530  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >& buffer1 =
1531  *static_cast<RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >*>(buffer);
1532  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > data = rr_cast<RRNamedMultiDimArray<T> >(
1533  GetNode()->UnpackNamedMultiDimArray(rr_cast<MessageElementNestedElementList>(res)));
1534 
1535  RR_SHARED_PTR<NamedMultiDimArrayMemory<T> > data2 = RR_MAKE_SHARED<NamedMultiDimArrayMemory<T> >(data);
1536  data2->Read(std::vector<uint64_t>(count.size()), buffer1, bufferpos, count);
1537  }
1538  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> PackWriteRequest(const void* buffer,
1539  const std::vector<uint64_t>& bufferpos,
1540  const std::vector<uint64_t>& count,
1541  uint64_t elemcount) RR_OVERRIDE
1542  {
1543  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > buffer1 =
1544  *static_cast<const RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> >*>(buffer);
1545 
1546  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > data = AllocateEmptyRRNamedMultiDimArray<T>();
1547  data->Dims = VectorToRRArray<uint32_t>(count);
1548  data->NamedArray = AllocateEmptyRRNamedArray<T>(boost::numeric_cast<size_t>(elemcount));
1549 
1550  buffer1->RetrieveSubArray(detail::ConvertVectorType<uint32_t>(bufferpos), data,
1551  std::vector<uint32_t>(count.size()), detail::ConvertVectorType<uint32_t>(count));
1552  return GetNode()->PackNamedMultiDimArray(data);
1553  }
1554 };
1555 
1556 template <typename T>
1557 class NamedMultiDimArrayMemoryServiceSkel : public MultiDimArrayMemoryServiceSkelBase
1558 {
1559  public:
1560  NamedMultiDimArrayMemoryServiceSkel(boost::string_ref membername, const RR_SHARED_PTR<ServiceSkel>& skel,
1561  size_t element_size, MemberDefinition_Direction direction)
1562  : MultiDimArrayMemoryServiceSkelBase(membername, skel, DataTypes_structure_t, element_size, direction)
1563  {}
1564 
1565  RR_OVIRTUAL RR_INTRUSIVE_PTR<MessageElementData> DoRead(
1566  const std::vector<uint64_t>& memorypos, const std::vector<uint64_t>& bufferpos,
1567  const std::vector<uint64_t>& count, uint32_t elemcount,
1568  const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
1569  {
1570  RR_SHARED_PTR<NamedMultiDimArrayMemory<T> > mem1 = rr_cast<NamedMultiDimArrayMemory<T> >(mem);
1571 
1572  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > data = AllocateEmptyRRNamedMultiDimArray<T>();
1573  data->Dims = VectorToRRArray<uint32_t>(count);
1574  data->NamedArray = AllocateEmptyRRNamedArray<T>(boost::numeric_cast<size_t>(elemcount));
1575 
1576  mem1->Read(memorypos, data, bufferpos, count);
1577  return GetNode()->PackNamedMultiDimArray(data);
1578  }
1579  RR_OVIRTUAL void DoWrite(const std::vector<uint64_t>& memorypos, const RR_INTRUSIVE_PTR<MessageElementData>& buffer,
1580  const std::vector<uint64_t>& bufferpos, const std::vector<uint64_t>& count,
1581  uint32_t elemcount, const RR_SHARED_PTR<MultiDimArrayMemoryBase>& mem) RR_OVERRIDE
1582  {
1583  RR_UNUSED(elemcount);
1584  RR_SHARED_PTR<NamedMultiDimArrayMemory<T> > mem1 = rr_cast<NamedMultiDimArrayMemory<T> >(mem);
1585 
1586  RR_INTRUSIVE_PTR<RRNamedMultiDimArray<T> > data = rr_cast<RRNamedMultiDimArray<T> >(
1587  GetNode()->UnpackNamedMultiDimArray(rr_cast<MessageElementNestedElementList>(buffer)));
1588  mem1->Write(memorypos, data, bufferpos, count);
1589  }
1590 };
1591 
1592 #ifndef ROBOTRACONTEUR_NO_CXX11_TEMPLATE_ALIASES
1594 using ArrayMemoryBasePtr = RR_SHARED_PTR<ArrayMemoryBase>;
1596 template <typename T>
1597 using ArrayMemoryPtr = RR_SHARED_PTR<ArrayMemory<T> >;
1599 using MultiDimArrayMemoryBasePtr = RR_SHARED_PTR<MultiDimArrayMemoryBase>;
1601 template <typename T>
1602 using MultiDimArrayMemoryPtr = RR_SHARED_PTR<MultiDimArrayMemory<T> >;
1604 template <typename T>
1605 using PodArrayMemoryPtr = RR_SHARED_PTR<PodArrayMemory<T> >;
1607 template <typename T>
1608 using PodMultiDimArrayMemoryPtr = RR_SHARED_PTR<PodMultiDimArrayMemory<T> >;
1610 template <typename T>
1611 using NamedArrayMemoryPtr = RR_SHARED_PTR<NamedArrayMemory<T> >;
1613 template <typename T>
1614 using NamedMultiDimArrayMemoryPtr = RR_SHARED_PTR<NamedMultiDimArrayMemory<T> >;
1615 #endif
1616 } // namespace RobotRaconteur
boost::shared_ptr< MultiDimArrayMemoryBase > MultiDimArrayMemoryBasePtr
Convenience alias for MultiDimArrayMemoryBase shared_ptr.
Definition: MemoryMember.h:1599
boost::shared_ptr< ArrayMemory< T > > ArrayMemoryPtr
Convenience alias for ArrayMemory shared_ptr.
Definition: MemoryMember.h:1597
boost::shared_ptr< ArrayMemoryBase > ArrayMemoryBasePtr
Convenience alias for ArrayMemoryBase shared_ptr.
Definition: MemoryMember.h:1594
boost::shared_ptr< PodMultiDimArrayMemory< T > > PodMultiDimArrayMemoryPtr
Convenience alias for PodMultiDimArrayMemory shared_ptr.
Definition: MemoryMember.h:1608
boost::shared_ptr< MultiDimArrayMemory< T > > MultiDimArrayMemoryPtr
Convenience alias for MultiDimArrayMemory shared_ptr.
Definition: MemoryMember.h:1602
boost::shared_ptr< NamedArrayMemory< T > > NamedArrayMemoryPtr
Convenience alias for NamedArrayMemory shared_ptr.
Definition: MemoryMember.h:1611
boost::shared_ptr< NamedMultiDimArrayMemory< T > > NamedMultiDimArrayMemoryPtr
Convenience alias for NamedMultiDimArrayMemory shared_ptr.
Definition: MemoryMember.h:1614
boost::shared_ptr< PodArrayMemory< T > > PodArrayMemoryPtr
Convenience alias for PodArrayMemory shared_ptr.
Definition: MemoryMember.h:1605
MemberDefinition_Direction
Member direction enum.
Definition: RobotRaconteurConstants.h:534
DataTypes
Type codes for types supported by Robot Raconteur.
Definition: RobotRaconteurConstants.h:41
@ DataTypes_structure_t
structure (nested message type)
Definition: RobotRaconteurConstants.h:73
@ DataTypes_pod_t
pod type (nested message type)
Definition: RobotRaconteurConstants.h:88
Base class for ArrayMemory.
Definition: MemoryMember.h:70
Single dimensional numeric primitive random access memory region.
Definition: MemoryMember.h:105
virtual void Read(uint64_t memorypos, boost::intrusive_ptr< RRArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Read a segment from an array memory.
Definition: MemoryMember.h:170
ArrayMemory(const boost::intrusive_ptr< RRArray< T > > &memory)
Construct a new ArrayMemory instance attached to an RRArrayPtr<T>
Definition: MemoryMember.h:129
ArrayMemory()
Construct a new ArrayMemory instance.
Definition: MemoryMember.h:118
virtual void Write(uint64_t memorypos, const boost::intrusive_ptr< RRArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Write a segment to an array memory.
Definition: MemoryMember.h:195
RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
Return the length of the array memory.
Definition: MemoryMember.h:150
virtual void Attach(const boost::intrusive_ptr< RRArray< T > > &memory)
Attach ArrayMemory instance to an RRArrayPtr<T>
Definition: MemoryMember.h:136
Base class for MultiDimArrayMemory.
Definition: MemoryMember.h:216
Multidimensional numeric primitive random access memory region.
Definition: MemoryMember.h:252
RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
The number of dimensions in the memory array.
Definition: MemoryMember.h:322
virtual void Read(const std::vector< uint64_t > &memorypos, boost::intrusive_ptr< RRMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Read a block from a multidimensional array memory.
Definition: MemoryMember.h:342
virtual void Write(const std::vector< uint64_t > &memorypos, const boost::intrusive_ptr< RRMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Write a segment to a multidimensional array memory.
Definition: MemoryMember.h:366
MultiDimArrayMemory()
Construct a new MultiDimArrayMemory instance.
Definition: MemoryMember.h:265
virtual void Attach(const boost::intrusive_ptr< RRMultiDimArray< T > > &multimemory)
Attach MultiDimArrayMemory instance to an RRMultiDimArrayPtr<T>
Definition: MemoryMember.h:285
RR_OVIRTUAL std::vector< uint64_t > Dimensions() RR_OVERRIDE
Dimensions of the memory array.
Definition: MemoryMember.h:301
MultiDimArrayMemory(const boost::intrusive_ptr< RRMultiDimArray< T > > &multimemory)
Construct a new MultiDimArrayMemory instance attached to an RRMultiDimArrayPtr<T>
Definition: MemoryMember.h:276
Single dimensional namedarray random access memory region.
Definition: MemoryMember.h:1197
virtual void Attach(const boost::intrusive_ptr< RRNamedArray< T > > &memory)
Attach NamedArrayMemory instance to an RRNamedArrayPtr<T>
Definition: MemoryMember.h:1228
NamedArrayMemory()
Construct a new NamedArrayMemory instance.
Definition: MemoryMember.h:1210
RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
Return the length of the array memory.
Definition: MemoryMember.h:1235
virtual void Read(uint64_t memorypos, boost::intrusive_ptr< RRNamedArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Read a segment from an array memory.
Definition: MemoryMember.h:1242
virtual void Write(uint64_t memorypos, const boost::intrusive_ptr< RRNamedArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Write a segment to an array memory.
Definition: MemoryMember.h:1259
NamedArrayMemory(const boost::intrusive_ptr< RRNamedArray< T > > &memory)
Construct a new NamedArrayMemory instance attached to an RRNamedArrayPtr<T>
Definition: MemoryMember.h:1221
Multidimensional namedarray random access memory region.
Definition: MemoryMember.h:1401
virtual void Attach(const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &multimemory)
Attach NamedMultiDimArrayMemory instance to an RRNamedMultiDimArrayPtr<T>
Definition: MemoryMember.h:1437
RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
The number of dimensions in the memory array.
Definition: MemoryMember.h:1458
virtual void Write(const std::vector< uint64_t > &memorypos, const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Write a segment to a multidimensional array memory.
Definition: MemoryMember.h:1475
virtual void Read(const std::vector< uint64_t > &memorypos, boost::intrusive_ptr< RRNamedMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Read a block from a multidimensional array memory.
Definition: MemoryMember.h:1465
NamedMultiDimArrayMemory(const boost::intrusive_ptr< RRNamedMultiDimArray< T > > &multimemory)
Construct a new NamedMultiDimArrayMemory instance attached to an RRNamedMultiDimArrayPtr<T>
Definition: MemoryMember.h:1425
NamedMultiDimArrayMemory()
Construct a new NamedMultiDimArrayMemory instance.
Definition: MemoryMember.h:1414
RR_OVIRTUAL std::vector< uint64_t > Dimensions() RR_OVERRIDE
Dimensions of the memory array.
Definition: MemoryMember.h:1444
Exception thrown when an attempt to acces an array or container index is out of range.
Definition: Error.h:870
Single dimensional pod random access memory region.
Definition: MemoryMember.h:774
virtual void Read(uint64_t memorypos, boost::intrusive_ptr< RRPodArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Read a segment from an array memory.
Definition: MemoryMember.h:819
virtual void Write(uint64_t memorypos, const boost::intrusive_ptr< RRPodArray< T > > &buffer, uint64_t bufferpos, uint64_t count)
Write a segment to an array memory.
Definition: MemoryMember.h:835
virtual void Attach(const boost::intrusive_ptr< RRPodArray< T > > &memory)
Attach PodArrayMemory instance to an RRPodArrayPtr<T>
Definition: MemoryMember.h:805
PodArrayMemory()
Construct a new PodArrayMemory instance.
Definition: MemoryMember.h:787
RR_OVIRTUAL uint64_t Length() RR_OVERRIDE
Return the length of the array memory.
Definition: MemoryMember.h:812
PodArrayMemory(const boost::intrusive_ptr< RRPodArray< T > > &memory)
Construct a new PodArrayMemory instance attached to an RRPodArrayPtr<T>
Definition: MemoryMember.h:798
Multidimensional pod random access memory region.
Definition: MemoryMember.h:977
virtual void Read(const std::vector< uint64_t > &memorypos, boost::intrusive_ptr< RRPodMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Read a block from a multidimensional array memory.
Definition: MemoryMember.h:1041
virtual void Attach(const boost::intrusive_ptr< RRPodMultiDimArray< T > > &multimemory)
Attach PodMultiDimArrayMemory instance to an RRPodMultiDimArrayPtr<T>
Definition: MemoryMember.h:1013
PodMultiDimArrayMemory()
Construct a new PodMultiDimArrayMemory instance.
Definition: MemoryMember.h:990
RR_OVIRTUAL uint64_t DimCount() RR_OVERRIDE
The number of dimensions in the memory array.
Definition: MemoryMember.h:1034
PodMultiDimArrayMemory(const boost::intrusive_ptr< RRPodMultiDimArray< T > > &multimemory)
Construct a new PodMultiDimArrayMemory instance attached to an RRPodMultiDimArrayPtr<T>
Definition: MemoryMember.h:1001
virtual void Write(const std::vector< uint64_t > &memorypos, const boost::intrusive_ptr< RRPodMultiDimArray< T > > &buffer, const std::vector< uint64_t > &bufferpos, const std::vector< uint64_t > &count)
Write a segment to a multidimensional array memory.
Definition: MemoryMember.h:1051
RR_OVIRTUAL std::vector< uint64_t > Dimensions() RR_OVERRIDE
Dimensions of the memory array.
Definition: MemoryMember.h:1020
Numeric primitive or character array value type.
Definition: DataTypes.h:580
Numeric primitive multidimensional array value type.
Definition: DataTypes.h:1600
namedarray array value type
Definition: DataTypes.h:2269
namedarray multidimensional array value type
Definition: DataTypes.h:2455
pod array value type
Definition: DataTypes.h:1887
std::vector< T >::size_type size_type
Definition: DataTypes.h:1917
pod multidimensional array value type
Definition: DataTypes.h:2040