Robot Raconteur Core C++ Library
Loading...
Searching...
No Matches
RobotRaconteur::ArrayMemory< T > Class Template Reference

Single dimensional numeric primitive random access memory region. More...

#include <MemoryMember.h>

Inheritance diagram for RobotRaconteur::ArrayMemory< T >:
RobotRaconteur::ArrayMemoryBase

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.

Detailed Description

template<typename T>
class RobotRaconteur::ArrayMemory< T >

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.

Template Parameters
TThe numeric primitive type of the array

Constructor & Destructor Documentation

◆ ArrayMemory() [1/2]

template<typename T>
RobotRaconteur::ArrayMemory< T >::ArrayMemory ( )
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> >();

◆ ArrayMemory() [2/2]

template<typename T>
RobotRaconteur::ArrayMemory< T >::ArrayMemory ( const boost::intrusive_ptr< RRArray< T > > & memory)
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> >();

Parameters
memoryThe array to attach

Member Function Documentation

◆ Attach()

template<typename T>
virtual void RobotRaconteur::ArrayMemory< T >::Attach ( const boost::intrusive_ptr< RRArray< T > > & memory)
inlinevirtual

Attach ArrayMemory instance to an RRArrayPtr<T>.

Parameters
memoryThe array to attach

◆ Length()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::ArrayMemory< T >::Length ( )
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.

Returns
uint64_t The length of the array memory

Implements RobotRaconteur::ArrayMemoryBase.

◆ Read()

template<typename T>
virtual void RobotRaconteur::ArrayMemory< T >::Read ( uint64_t memorypos,
boost::intrusive_ptr< RRArray< T > > & buffer,
uint64_t bufferpos,
uint64_t count )
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.

Parameters
memoryposThe start index in the memory array to read
bufferThe buffer to receive the read data
bufferposThe start index in the buffer to write the data
countThe number of array elements to read

◆ Write()

template<typename T>
virtual void RobotRaconteur::ArrayMemory< T >::Write ( uint64_t memorypos,
const boost::intrusive_ptr< RRArray< T > > & buffer,
uint64_t bufferpos,
uint64_t count )
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.

Parameters
memoryposThe start index in the memory array to write
bufferThe buffer to write the data from
bufferposThe start index in the buffer to read the data
countThe number of array elements to write

The documentation for this class was generated from the following file: