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

Multidimensional numeric primitive random access memory region. More...

#include <MemoryMember.h>

Inheritance diagram for RobotRaconteur::MultiDimArrayMemory< T >:
RobotRaconteur::MultiDimArrayMemoryBase

Public Member Functions

 MultiDimArrayMemory ()
 Construct a new MultiDimArrayMemory instance.
 MultiDimArrayMemory (const boost::intrusive_ptr< RRMultiDimArray< T > > &multimemory)
 Construct a new MultiDimArrayMemory instance attached to an RRMultiDimArrayPtr<T>.
virtual void Attach (const boost::intrusive_ptr< RRMultiDimArray< T > > &multimemory)
 Attach MultiDimArrayMemory instance to an RRMultiDimArrayPtr<T>.
RR_OVIRTUAL std::vector< uint64_t > Dimensions () RR_OVERRIDE
 Dimensions of the memory array.
RR_OVIRTUAL uint64_t DimCount () RR_OVERRIDE
 The number of dimensions in the memory array.
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.
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.

Detailed Description

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

Multidimensional 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 MultiDimArrayMemory class is used to represent a multidimensional numeric primitive array. Single dimensional numeric primitive arrays should use ArrayMemory. 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.

MultiDimArrayMemory instances are attached to an RRMultiDimArrayPtr<T>, either when constructed or later using Attach().

MultiDimArrayMemory 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

◆ MultiDimArrayMemory() [1/2]

template<typename T>
RobotRaconteur::MultiDimArrayMemory< T >::MultiDimArrayMemory ( )
inline

Construct a new MultiDimArrayMemory instance.

New instance will not be attached to an array.

MultiDimArrayMemory must be constructed with boost::make_shared<MultiDimArrayMemory<T> >();

◆ MultiDimArrayMemory() [2/2]

template<typename T>
RobotRaconteur::MultiDimArrayMemory< T >::MultiDimArrayMemory ( const boost::intrusive_ptr< RRMultiDimArray< T > > & multimemory)
inline

Construct a new MultiDimArrayMemory instance attached to an RRMultiDimArrayPtr<T>.

New instance will be constructed attached to an array.

MultiDimArrayMemory must be constructed with boost::make_shared<MultiDimArrayMemory<T> >();

Parameters
multimemoryThe array to attach

Member Function Documentation

◆ Attach()

template<typename T>
virtual void RobotRaconteur::MultiDimArrayMemory< T >::Attach ( const boost::intrusive_ptr< RRMultiDimArray< T > > & multimemory)
inlinevirtual

Attach MultiDimArrayMemory instance to an RRMultiDimArrayPtr<T>.

Parameters
multimemoryThe array to attach

◆ DimCount()

template<typename T>
RR_OVIRTUAL uint64_t RobotRaconteur::MultiDimArrayMemory< T >::DimCount ( )
inlinevirtual

The number of dimensions in the memory array.

When used with a memory returned by a client, this function will call the service to execute the request.

Returns
uint64_t Number of dimensions

Implements RobotRaconteur::MultiDimArrayMemoryBase.

◆ Dimensions()

template<typename T>
RR_OVIRTUAL std::vector< uint64_t > RobotRaconteur::MultiDimArrayMemory< T >::Dimensions ( )
inlinevirtual

Dimensions of the memory array.

Returns the dimensions (shape) of the memory array

When used with a memory returned by a client, this function will call the service to execute the request.

Returns
std::vector<uint64_t> The dimensions of the memory array

Implements RobotRaconteur::MultiDimArrayMemoryBase.

◆ Read()

template<typename T>
virtual void RobotRaconteur::MultiDimArrayMemory< T >::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 )
inlinevirtual

Read a block from a multidimensional array memory.

Read a block of a multidimensional array memory into a supplied buffer multidimensional array. The start positions and count 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 position in the memory array to read
bufferThe buffer to receive the read data
bufferposThe start position in the buffer to write the data
countThe count of array elements to read

◆ Write()

template<typename T>
virtual void RobotRaconteur::MultiDimArrayMemory< T >::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 )
inlinevirtual

Write a segment to a multidimensional array memory.

Writes a segment to a multidimensional array memory from a supplied buffer multidimensional array. The start positions and count 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 position in the memory array to write
bufferThe buffer to write the data from
bufferposThe start position in the buffer to read the data
countThe count of array elements to write

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