|
Robot Raconteur Core C++ Library
|
Single dimensional numeric primitive random access memory region. More...
#include <MemoryMember.h>
Public Member Functions | |
| ArrayMemory () | |
| Construct a new ArrayMemory instance. | |
| ArrayMemory (const boost::intrusive_ptr< RRArray< T > > &memory) | |
| Construct a new ArrayMemory instance attached to an RRArrayPtr<T>. | |
| virtual void | Attach (const boost::intrusive_ptr< RRArray< T > > &memory) |
| Attach ArrayMemory instance to an RRArrayPtr<T>. | |
| RR_OVIRTUAL uint64_t | Length () RR_OVERRIDE |
| Return the length of the array memory. | |
| 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. | |
| 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. | |
Single dimensional numeric primitive random access memory region.
Memories represent random access memory regions that are typically represented as arrays of various shapes and types. Memories can be declared in service definition files using the memory member keyword within service definitions. Services expose memories to clients, and the nodes will proxy read, write, and parameter requests between the client and service. The node will also break up large requests to avoid the message size limit of the transport.
The ArrayMemory class is used to represent a single dimensional numeric primitive array. Multidimensional numeric primitive arrays should use MultiDimArrayMemory. Valid types for T are double, float, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, rr_bool, cdouble, and csingle.
ArrayMemory instances are attached to an RRArrayPtr<T>, either when constructed or later using Attach().
ArrayMemory instances returned by clients are special implementations designed to proxy requests to the service. They cannot be attached to an arbitrary array.
| T | The numeric primitive type of the array |
|
inline |
Construct a new ArrayMemory instance.
New instance will not be attached to an array.
ArrayMemory must be constructed with boost::make_shared<ArrayMemory<T> >();
|
inline |
Construct a new ArrayMemory instance attached to an RRArrayPtr<T>.
New instance will be constructed attached to an array.
ArrayMemory must be constructed with boost::make_shared<ArrayMemory<T> >();
| memory | The array to attach |
|
inlinevirtual |
Attach ArrayMemory instance to an RRArrayPtr<T>.
| memory | The array to attach |
|
inlinevirtual |
Return the length of the array memory.
When used with a memory returned by a client, this function will call the service to execute the request.
Implements RobotRaconteur::ArrayMemoryBase.
|
inlinevirtual |
Read a segment from an array memory.
Read a segment of an array memory into a supplied buffer array. The start positions and length of the read are specified.
When used with a memory returned by a client, this function will call the service to execute the request.
| memorypos | The start index in the memory array to read |
| buffer | The buffer to receive the read data |
| bufferpos | The start index in the buffer to write the data |
| count | The number of array elements to read |
|
inlinevirtual |
Write a segment to an array memory.
Writes a segment to an array memory from a supplied buffer array. The start positions and length of the write are specified.
When used with a memory returned by a client, this function will call the service to execute the request.
| memorypos | The start index in the memory array to write |
| buffer | The buffer to write the data from |
| bufferpos | The start index in the buffer to read the data |
| count | The number of array elements to write |